From: bluhm Date: Tue, 25 May 2021 09:55:22 +0000 (+0000) Subject: The arrays sadb_exts_allowed_out and sadb_exts_required_out are X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=51638830b468b0ed9277bd5236661921a90fcb07;p=openbsd The arrays sadb_exts_allowed_out and sadb_exts_required_out are constant. Put global variable declarations into header file. OK mvs@ mpi@ --- diff --git a/sys/net/pfkeyv2.c b/sys/net/pfkeyv2.c index 3a5693f630b..23f4d00a3b0 100644 --- a/sys/net/pfkeyv2.c +++ b/sys/net/pfkeyv2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfkeyv2.c,v 1.211 2021/05/04 09:28:04 mvs Exp $ */ +/* $OpenBSD: pfkeyv2.c,v 1.212 2021/05/25 09:55:22 bluhm Exp $ */ /* * @(#)COPYRIGHT 1.1 (NRL) 17 January 1995 @@ -122,11 +122,6 @@ static const struct sadb_alg calgs[] = { { SADB_X_CALG_LZS, 0, 0, 0} }; -extern uint64_t sadb_exts_allowed_out[SADB_MAX+1]; -extern uint64_t sadb_exts_required_out[SADB_MAX+1]; - -extern struct pool ipsec_policy_pool; - struct pool pkpcb_pool; #define PFKEY_MSG_MAXSZ 4096 const struct sockaddr pfkey_addr = { 2, PF_KEY, }; diff --git a/sys/net/pfkeyv2.h b/sys/net/pfkeyv2.h index bef399018a9..ff460c808a0 100644 --- a/sys/net/pfkeyv2.h +++ b/sys/net/pfkeyv2.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pfkeyv2.h,v 1.86 2020/12/14 20:20:06 tobhe Exp $ */ +/* $OpenBSD: pfkeyv2.h,v 1.87 2021/05/25 09:55:22 bluhm Exp $ */ /* * @(#)COPYRIGHT 1.1 (NRL) January 1998 * @@ -436,6 +436,11 @@ void import_udpencap(struct tdb *, struct sadb_x_udpencap *); void import_tag(struct tdb *, struct sadb_x_tag *); void import_rdomain(struct tdb *, struct sadb_x_rdomain *); void import_tap(struct tdb *, struct sadb_x_tap *); + +extern const uint64_t sadb_exts_allowed_out[SADB_MAX+1]; +extern const uint64_t sadb_exts_required_out[SADB_MAX+1]; + +extern struct pool ipsec_policy_pool; #endif /* _KERNEL */ #endif /* _NET_PFKEY_V2_H_ */ diff --git a/sys/net/pfkeyv2_parsemessage.c b/sys/net/pfkeyv2_parsemessage.c index 47b6d6bd5a1..b4fd2dc8286 100644 --- a/sys/net/pfkeyv2_parsemessage.c +++ b/sys/net/pfkeyv2_parsemessage.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfkeyv2_parsemessage.c,v 1.56 2021/05/06 11:29:34 mvs Exp $ */ +/* $OpenBSD: pfkeyv2_parsemessage.c,v 1.57 2021/05/25 09:55:22 bluhm Exp $ */ /* * @(#)COPYRIGHT 1.1 (NRL) 17 January 1995 @@ -201,7 +201,7 @@ uint64_t sadb_exts_required_in[SADB_MAX+1] = BITMAP_X_POLICY, }; -uint64_t sadb_exts_allowed_out[SADB_MAX+1] = +const uint64_t sadb_exts_allowed_out[SADB_MAX+1] = { /* RESERVED */ ~0, @@ -237,7 +237,7 @@ uint64_t sadb_exts_allowed_out[SADB_MAX+1] = BITMAP_X_SRC_FLOW | BITMAP_X_DST_FLOW | BITMAP_X_SRC_MASK | BITMAP_X_DST_MASK | BITMAP_X_FLOW_TYPE | BITMAP_X_POLICY, }; -uint64_t sadb_exts_required_out[SADB_MAX+1] = +const uint64_t sadb_exts_required_out[SADB_MAX+1] = { /* RESERVED */ 0,