aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Turner <andrew@FreeBSD.org>2018-07-24 16:35:52 +0000
committerAndrew Turner <andrew@FreeBSD.org>2018-07-24 16:35:52 +0000
commit5f901c92a8d99227901f548f0b755b31d9dd8525 (patch)
tree90ee09df9416f8603c23b2fa89cb65e6da1c5637
parent8f958ba91e49bdac1b41f93245619d547618a2b1 (diff)
downloadsrc-5f901c92a8d99227901f548f0b755b31d9dd8525.tar.gz
src-5f901c92a8d99227901f548f0b755b31d9dd8525.zip
Use the new VNET_DEFINE_STATIC macro when we are defining static VNET
variables. Reviewed by: bz Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D16147
Notes
Notes: svn path=/head/; revision=336676
-rw-r--r--sys/contrib/ipfilter/netinet/ip_rpcb_pxy.c2
-rw-r--r--sys/net/bpf.c2
-rw-r--r--sys/net/ieee8023ad_lacp.c4
-rw-r--r--sys/net/if.c2
-rw-r--r--sys/net/if_bridge.c24
-rw-r--r--sys/net/if_clone.c2
-rw-r--r--sys/net/if_disc.c2
-rw-r--r--sys/net/if_edsc.c2
-rw-r--r--sys/net/if_enc.c12
-rw-r--r--sys/net/if_epair.c2
-rw-r--r--sys/net/if_ethersubr.c2
-rw-r--r--sys/net/if_gif.c4
-rw-r--r--sys/net/if_gre.c4
-rw-r--r--sys/net/if_ipsec.c8
-rw-r--r--sys/net/if_lagg.c10
-rw-r--r--sys/net/if_llatbl.c2
-rw-r--r--sys/net/if_loop.c2
-rw-r--r--sys/net/if_me.c6
-rw-r--r--sys/net/if_vlan.c2
-rw-r--r--sys/net/netisr.c2
-rw-r--r--sys/net/route.c2
-rw-r--r--sys/net/rtsock.c2
-rw-r--r--sys/net/vnet.c2
-rw-r--r--sys/netgraph/ng_base.c14
-rw-r--r--sys/netgraph/ng_eiface.c2
-rw-r--r--sys/netgraph/ng_iface.c2
-rw-r--r--sys/netinet/cc/cc_cdg.c14
-rw-r--r--sys/netinet/cc/cc_chd.c10
-rw-r--r--sys/netinet/cc/cc_dctcp.c6
-rw-r--r--sys/netinet/cc/cc_hd.c6
-rw-r--r--sys/netinet/cc/cc_htcp.c4
-rw-r--r--sys/netinet/cc/cc_newreno.c4
-rw-r--r--sys/netinet/cc/cc_vegas.c4
-rw-r--r--sys/netinet/if_ether.c12
-rw-r--r--sys/netinet/igmp.c26
-rw-r--r--sys/netinet/in.c2
-rw-r--r--sys/netinet/in_gif.c6
-rw-r--r--sys/netinet/in_pcb.c2
-rw-r--r--sys/netinet/ip_carp.c14
-rw-r--r--sys/netinet/ip_divert.c4
-rw-r--r--sys/netinet/ip_gre.c2
-rw-r--r--sys/netinet/ip_icmp.c22
-rw-r--r--sys/netinet/ip_id.c20
-rw-r--r--sys/netinet/ip_input.c6
-rw-r--r--sys/netinet/ip_mroute.c36
-rw-r--r--sys/netinet/ip_options.c4
-rw-r--r--sys/netinet/ip_reass.c10
-rw-r--r--sys/netinet/tcp_fastopen.c24
-rw-r--r--sys/netinet/tcp_hostcache.c4
-rw-r--r--sys/netinet/tcp_subr.c16
-rw-r--r--sys/netinet/tcp_syncache.c8
-rw-r--r--sys/netinet/tcp_timewait.c8
-rw-r--r--sys/netinet/udp_usrreq.c2
-rw-r--r--sys/netinet6/frag6.c6
-rw-r--r--sys/netinet6/icmp6.c4
-rw-r--r--sys/netinet6/in6_gif.c6
-rw-r--r--sys/netinet6/in6_rmx.c4
-rw-r--r--sys/netinet6/in6_src.c4
-rw-r--r--sys/netinet6/ip6_gre.c2
-rw-r--r--sys/netinet6/ip6_mroute.c6
-rw-r--r--sys/netinet6/mld6.c10
-rw-r--r--sys/netinet6/nd6.c6
-rw-r--r--sys/netinet6/nd6_nbr.c8
-rw-r--r--sys/netinet6/nd6_rtr.c2
-rw-r--r--sys/netinet6/scope6.c2
-rw-r--r--sys/netinet6/send.c2
-rw-r--r--sys/netipsec/ipsec.c8
-rw-r--r--sys/netipsec/key.c74
-rw-r--r--sys/netipsec/keysock.c2
-rw-r--r--sys/netpfil/ipfw/ip_fw2.c4
-rw-r--r--sys/netpfil/ipfw/ip_fw_bpf.c8
-rw-r--r--sys/netpfil/ipfw/ip_fw_dynamic.c80
-rw-r--r--sys/netpfil/ipfw/ip_fw_pfil.c6
-rw-r--r--sys/netpfil/ipfw/ip_fw_sockopt.c2
-rw-r--r--sys/netpfil/ipfw/nptv6/nptv6.c2
-rw-r--r--sys/netpfil/ipfw/pmod/tcpmod.c2
-rw-r--r--sys/netpfil/pf/if_pflog.c2
-rw-r--r--sys/netpfil/pf/if_pfsync.c8
-rw-r--r--sys/netpfil/pf/pf.c10
-rw-r--r--sys/netpfil/pf/pf_if.c12
-rw-r--r--sys/netpfil/pf/pf_ioctl.c4
-rw-r--r--sys/netpfil/pf/pf_norm.c8
-rw-r--r--sys/netpfil/pf/pf_osfp.c2
-rw-r--r--sys/netpfil/pf/pf_table.c10
84 files changed, 351 insertions, 351 deletions
diff --git a/sys/contrib/ipfilter/netinet/ip_rpcb_pxy.c b/sys/contrib/ipfilter/netinet/ip_rpcb_pxy.c
index e155771478a3..727e731cd0e3 100644
--- a/sys/contrib/ipfilter/netinet/ip_rpcb_pxy.c
+++ b/sys/contrib/ipfilter/netinet/ip_rpcb_pxy.c
@@ -80,7 +80,7 @@ static void ipf_p_rpcb_fixlen __P((fr_info_t *, int));
*/
static frentry_t rpcbfr; /* Skeleton rule for reference by entities
this proxy creates. */
-static VNET_DEFINE(int, rpcbcnt);
+VNET_DEFINE_STATIC(int, rpcbcnt);
#define V_rpcbcnt VNET(rpcbcnt)
/* Upper bound of allocated RPCB sessions. */
/* XXX rpcbcnt still requires locking. */
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index 3c9c99d2dc78..32785f19668d 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -213,7 +213,7 @@ SYSCTL_INT(_net_bpf, OID_AUTO, zerocopy_enable, CTLFLAG_RW,
static SYSCTL_NODE(_net_bpf, OID_AUTO, stats, CTLFLAG_MPSAFE | CTLFLAG_RW,
bpf_stats_sysctl, "bpf statistics portal");
-static VNET_DEFINE(int, bpf_optimize_writers) = 0;
+VNET_DEFINE_STATIC(int, bpf_optimize_writers) = 0;
#define V_bpf_optimize_writers VNET(bpf_optimize_writers)
SYSCTL_INT(_net_bpf, OID_AUTO, optimize_writers, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(bpf_optimize_writers), 0,
diff --git a/sys/net/ieee8023ad_lacp.c b/sys/net/ieee8023ad_lacp.c
index efc5655ee096..68b42ddd4212 100644
--- a/sys/net/ieee8023ad_lacp.c
+++ b/sys/net/ieee8023ad_lacp.c
@@ -194,13 +194,13 @@ static const char *lacp_format_portid(const struct lacp_portid *, char *,
static void lacp_dprintf(const struct lacp_port *, const char *, ...)
__attribute__((__format__(__printf__, 2, 3)));
-static VNET_DEFINE(int, lacp_debug);
+VNET_DEFINE_STATIC(int, lacp_debug);
#define V_lacp_debug VNET(lacp_debug)
SYSCTL_NODE(_net_link_lagg, OID_AUTO, lacp, CTLFLAG_RD, 0, "ieee802.3ad");
SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, debug, CTLFLAG_RWTUN | CTLFLAG_VNET,
&VNET_NAME(lacp_debug), 0, "Enable LACP debug logging (1=debug, 2=trace)");
-static VNET_DEFINE(int, lacp_default_strict_mode) = 1;
+VNET_DEFINE_STATIC(int, lacp_default_strict_mode) = 1;
SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, default_strict_mode,
CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(lacp_default_strict_mode), 0,
"LACP strict protocol compliance default");
diff --git a/sys/net/if.c b/sys/net/if.c
index f398bc1075c0..6e3d097f7b47 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -293,7 +293,7 @@ int ifqmaxlen = IFQ_MAXLEN;
VNET_DEFINE(struct ifnethead, ifnet); /* depend on static init XXX */
VNET_DEFINE(struct ifgrouphead, ifg_head);
-static VNET_DEFINE(int, if_indexlim) = 8;
+VNET_DEFINE_STATIC(int, if_indexlim) = 8;
/* Table of ifnet by index. */
VNET_DEFINE(struct ifnet **, ifindex_table);
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index 6c84d760b717..578e0756498b 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -229,7 +229,7 @@ struct bridge_softc {
u_char sc_defaddr[6]; /* Default MAC address */
};
-static VNET_DEFINE(struct mtx, bridge_list_mtx);
+VNET_DEFINE_STATIC(struct mtx, bridge_list_mtx);
#define V_bridge_list_mtx VNET(bridge_list_mtx)
static eventhandler_tag bridge_detach_cookie;
@@ -354,59 +354,59 @@ SYSCTL_DECL(_net_link);
static SYSCTL_NODE(_net_link, IFT_BRIDGE, bridge, CTLFLAG_RW, 0, "Bridge");
/* only pass IP[46] packets when pfil is enabled */
-static VNET_DEFINE(int, pfil_onlyip) = 1;
+VNET_DEFINE_STATIC(int, pfil_onlyip) = 1;
#define V_pfil_onlyip VNET(pfil_onlyip)
SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_onlyip,
CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(pfil_onlyip), 0,
"Only pass IP packets when pfil is enabled");
/* run pfil hooks on the bridge interface */
-static VNET_DEFINE(int, pfil_bridge) = 1;
+VNET_DEFINE_STATIC(int, pfil_bridge) = 1;
#define V_pfil_bridge VNET(pfil_bridge)
SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_bridge,
CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(pfil_bridge), 0,
"Packet filter on the bridge interface");
/* layer2 filter with ipfw */
-static VNET_DEFINE(int, pfil_ipfw);
+VNET_DEFINE_STATIC(int, pfil_ipfw);
#define V_pfil_ipfw VNET(pfil_ipfw)
/* layer2 ARP filter with ipfw */
-static VNET_DEFINE(int, pfil_ipfw_arp);
+VNET_DEFINE_STATIC(int, pfil_ipfw_arp);
#define V_pfil_ipfw_arp VNET(pfil_ipfw_arp)
SYSCTL_INT(_net_link_bridge, OID_AUTO, ipfw_arp,
CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(pfil_ipfw_arp), 0,
"Filter ARP packets through IPFW layer2");
/* run pfil hooks on the member interface */
-static VNET_DEFINE(int, pfil_member) = 1;
+VNET_DEFINE_STATIC(int, pfil_member) = 1;
#define V_pfil_member VNET(pfil_member)
SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_member,
CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(pfil_member), 0,
"Packet filter on the member interface");
/* run pfil hooks on the physical interface for locally destined packets */
-static VNET_DEFINE(int, pfil_local_phys);
+VNET_DEFINE_STATIC(int, pfil_local_phys);
#define V_pfil_local_phys VNET(pfil_local_phys)
SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_local_phys,
CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(pfil_local_phys), 0,
"Packet filter on the physical interface for locally destined packets");
/* log STP state changes */
-static VNET_DEFINE(int, log_stp);
+VNET_DEFINE_STATIC(int, log_stp);
#define V_log_stp VNET(log_stp)
SYSCTL_INT(_net_link_bridge, OID_AUTO, log_stp,
CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(log_stp), 0,
"Log STP state changes");
/* share MAC with first bridge member */
-static VNET_DEFINE(int, bridge_inherit_mac);
+VNET_DEFINE_STATIC(int, bridge_inherit_mac);
#define V_bridge_inherit_mac VNET(bridge_inherit_mac)
SYSCTL_INT(_net_link_bridge, OID_AUTO, inherit_mac,
CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(bridge_inherit_mac), 0,
"Inherit MAC address from the first bridge member");
-static VNET_DEFINE(int, allow_llz_overlap) = 0;
+VNET_DEFINE_STATIC(int, allow_llz_overlap) = 0;
#define V_allow_llz_overlap VNET(allow_llz_overlap)
SYSCTL_INT(_net_link_bridge, OID_AUTO, allow_llz_overlap,
CTLFLAG_RW | CTLFLAG_VNET, &VNET_NAME(allow_llz_overlap), 0,
@@ -510,7 +510,7 @@ const struct bridge_control bridge_control_table[] = {
};
const int bridge_control_table_size = nitems(bridge_control_table);
-static VNET_DEFINE(LIST_HEAD(, bridge_softc), bridge_list);
+VNET_DEFINE_STATIC(LIST_HEAD(, bridge_softc), bridge_list);
#define V_bridge_list VNET(bridge_list)
#define BRIDGE_LIST_LOCK_INIT(x) mtx_init(&V_bridge_list_mtx, \
"if_bridge list", NULL, MTX_DEF)
@@ -518,7 +518,7 @@ static VNET_DEFINE(LIST_HEAD(, bridge_softc), bridge_list);
#define BRIDGE_LIST_LOCK(x) mtx_lock(&V_bridge_list_mtx)
#define BRIDGE_LIST_UNLOCK(x) mtx_unlock(&V_bridge_list_mtx)
-static VNET_DEFINE(struct if_clone *, bridge_cloner);
+VNET_DEFINE_STATIC(struct if_clone *, bridge_cloner);
#define V_bridge_cloner VNET(bridge_cloner)
static const char bridge_name[] = "bridge";
diff --git a/sys/net/if_clone.c b/sys/net/if_clone.c
index 4951ea99ef73..6207ff0c037e 100644
--- a/sys/net/if_clone.c
+++ b/sys/net/if_clone.c
@@ -108,7 +108,7 @@ static int ifc_simple_destroy(struct if_clone *, struct ifnet *);
static struct mtx if_cloners_mtx;
MTX_SYSINIT(if_cloners_lock, &if_cloners_mtx, "if_cloners lock", MTX_DEF);
-static VNET_DEFINE(int, if_cloners_count);
+VNET_DEFINE_STATIC(int, if_cloners_count);
VNET_DEFINE(LIST_HEAD(, if_clone), if_cloners);
#define V_if_cloners_count VNET(if_cloners_count)
diff --git a/sys/net/if_disc.c b/sys/net/if_disc.c
index b7dcba626743..ac0028c42f70 100644
--- a/sys/net/if_disc.c
+++ b/sys/net/if_disc.c
@@ -76,7 +76,7 @@ static void disc_clone_destroy(struct ifnet *);
static const char discname[] = "disc";
static MALLOC_DEFINE(M_DISC, discname, "Discard interface");
-static VNET_DEFINE(struct if_clone *, disc_cloner);
+VNET_DEFINE_STATIC(struct if_clone *, disc_cloner);
#define V_disc_cloner VNET(disc_cloner)
static int
diff --git a/sys/net/if_edsc.c b/sys/net/if_edsc.c
index cfd7dbeb72b4..4e262a64991b 100644
--- a/sys/net/if_edsc.c
+++ b/sys/net/if_edsc.c
@@ -72,7 +72,7 @@ struct edsc_softc {
/*
* Attach to the interface cloning framework.
*/
-static VNET_DEFINE(struct if_clone *, edsc_cloner);
+VNET_DEFINE_STATIC(struct if_clone *, edsc_cloner);
#define V_edsc_cloner VNET(edsc_cloner)
static int edsc_clone_create(struct if_clone *, int, caddr_t);
static void edsc_clone_destroy(struct ifnet *);
diff --git a/sys/net/if_enc.c b/sys/net/if_enc.c
index 9ddec1d01c30..01e416535dbd 100644
--- a/sys/net/if_enc.c
+++ b/sys/net/if_enc.c
@@ -86,9 +86,9 @@ struct enchdr {
struct enc_softc {
struct ifnet *sc_ifp;
};
-static VNET_DEFINE(struct enc_softc *, enc_sc);
+VNET_DEFINE_STATIC(struct enc_softc *, enc_sc);
#define V_enc_sc VNET(enc_sc)
-static VNET_DEFINE(struct if_clone *, enc_cloner);
+VNET_DEFINE_STATIC(struct if_clone *, enc_cloner);
#define V_enc_cloner VNET(enc_cloner)
static int enc_ioctl(struct ifnet *, u_long, caddr_t);
@@ -111,10 +111,10 @@ static const char encname[] = "enc";
* some changes to the packet, e.g. address translation. If PFIL hook
* consumes mbuf, nothing will be captured.
*/
-static VNET_DEFINE(int, filter_mask_in) = IPSEC_ENC_BEFORE;
-static VNET_DEFINE(int, bpf_mask_in) = IPSEC_ENC_BEFORE;
-static VNET_DEFINE(int, filter_mask_out) = IPSEC_ENC_BEFORE;
-static VNET_DEFINE(int, bpf_mask_out) = IPSEC_ENC_BEFORE | IPSEC_ENC_AFTER;
+VNET_DEFINE_STATIC(int, filter_mask_in) = IPSEC_ENC_BEFORE;
+VNET_DEFINE_STATIC(int, bpf_mask_in) = IPSEC_ENC_BEFORE;
+VNET_DEFINE_STATIC(int, filter_mask_out) = IPSEC_ENC_BEFORE;
+VNET_DEFINE_STATIC(int, bpf_mask_out) = IPSEC_ENC_BEFORE | IPSEC_ENC_AFTER;
#define V_filter_mask_in VNET(filter_mask_in)
#define V_bpf_mask_in VNET(bpf_mask_in)
#define V_filter_mask_out VNET(filter_mask_out)
diff --git a/sys/net/if_epair.c b/sys/net/if_epair.c
index 7df837e6e675..b28fe2b4bd30 100644
--- a/sys/net/if_epair.c
+++ b/sys/net/if_epair.c
@@ -180,7 +180,7 @@ STAILQ_HEAD(eid_list, epair_ifp_drain);
static MALLOC_DEFINE(M_EPAIR, epairname,
"Pair of virtual cross-over connected Ethernet-like interfaces");
-static VNET_DEFINE(struct if_clone *, epair_cloner);
+VNET_DEFINE_STATIC(struct if_clone *, epair_cloner);
#define V_epair_cloner VNET(epair_cloner)
/*
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 080bdfef3c37..713062f18c6f 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -1291,7 +1291,7 @@ static SYSCTL_NODE(_net_link, IFT_L2VLAN, vlan, CTLFLAG_RW, 0,
static SYSCTL_NODE(_net_link_vlan, PF_LINK, link, CTLFLAG_RW, 0,
"for consistency");
-static VNET_DEFINE(int, soft_pad);
+VNET_DEFINE_STATIC(int, soft_pad);
#define V_soft_pad VNET(soft_pad)
SYSCTL_INT(_net_link_vlan, OID_AUTO, soft_pad, CTLFLAG_RW | CTLFLAG_VNET,
&VNET_NAME(soft_pad), 0,
diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c
index 415409610500..868d829bbd2d 100644
--- a/sys/net/if_gif.c
+++ b/sys/net/if_gif.c
@@ -110,7 +110,7 @@ static int gif_transmit(struct ifnet *, struct mbuf *);
static void gif_qflush(struct ifnet *);
static int gif_clone_create(struct if_clone *, int, caddr_t);
static void gif_clone_destroy(struct ifnet *);
-static VNET_DEFINE(struct if_clone *, gif_cloner);
+VNET_DEFINE_STATIC(struct if_clone *, gif_cloner);
#define V_gif_cloner VNET(gif_cloner)
SYSCTL_DECL(_net_link);
@@ -127,7 +127,7 @@ static SYSCTL_NODE(_net_link, IFT_GIF, gif, CTLFLAG_RW, 0,
*/
#define MAX_GIF_NEST 1
#endif
-static VNET_DEFINE(int, max_gif_nesting) = MAX_GIF_NEST;
+VNET_DEFINE_STATIC(int, max_gif_nesting) = MAX_GIF_NEST;
#define V_max_gif_nesting VNET(max_gif_nesting)
SYSCTL_INT(_net_link_gif, OID_AUTO, max_nesting, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(max_gif_nesting), 0, "Max nested tunnels");
diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c
index 2ef1a35497b2..591396c588dd 100644
--- a/sys/net/if_gre.c
+++ b/sys/net/if_gre.c
@@ -94,7 +94,7 @@ SX_SYSINIT(gre_ioctl_sx, &gre_ioctl_sx, "gre_ioctl");
static int gre_clone_create(struct if_clone *, int, caddr_t);
static void gre_clone_destroy(struct ifnet *);
-static VNET_DEFINE(struct if_clone *, gre_cloner);
+VNET_DEFINE_STATIC(struct if_clone *, gre_cloner);
#define V_gre_cloner VNET(gre_cloner)
static void gre_qflush(struct ifnet *);
@@ -119,7 +119,7 @@ static SYSCTL_NODE(_net_link, IFT_TUNNEL, gre, CTLFLAG_RW, 0,
#define MAX_GRE_NEST 1
#endif
-static VNET_DEFINE(int, max_gre_nesting) = MAX_GRE_NEST;
+VNET_DEFINE_STATIC(int, max_gre_nesting) = MAX_GRE_NEST;
#define V_max_gre_nesting VNET(max_gre_nesting)
SYSCTL_INT(_net_link_gre, OID_AUTO, max_nesting, CTLFLAG_RW | CTLFLAG_VNET,
&VNET_NAME(max_gre_nesting), 0, "Max nested tunnels");
diff --git a/sys/net/if_ipsec.c b/sys/net/if_ipsec.c
index c9dcbc6488af..c4db90fe85c2 100644
--- a/sys/net/if_ipsec.c
+++ b/sys/net/if_ipsec.c
@@ -120,9 +120,9 @@ RM_SYSINIT(ipsec_sc_lock, &ipsec_sc_lock, "if_ipsec softc list");
#define IPSEC_SC_WLOCK_ASSERT() rm_assert(&ipsec_sc_lock, RA_WLOCKED)
LIST_HEAD(ipsec_iflist, ipsec_softc);
-static VNET_DEFINE(struct ipsec_iflist, ipsec_sc_list);
-static VNET_DEFINE(struct ipsec_iflist *, ipsec_sc_htbl);
-static VNET_DEFINE(u_long, ipsec_sc_hmask);
+VNET_DEFINE_STATIC(struct ipsec_iflist, ipsec_sc_list);
+VNET_DEFINE_STATIC(struct ipsec_iflist *, ipsec_sc_htbl);
+VNET_DEFINE_STATIC(u_long, ipsec_sc_hmask);
#define V_ipsec_sc_list VNET(ipsec_sc_list)
#define V_ipsec_sc_htbl VNET(ipsec_sc_htbl)
#define V_ipsec_sc_hmask VNET(ipsec_sc_hmask)
@@ -162,7 +162,7 @@ static void ipsec_qflush(struct ifnet *);
static int ipsec_clone_create(struct if_clone *, int, caddr_t);
static void ipsec_clone_destroy(struct ifnet *);
-static VNET_DEFINE(struct if_clone *, ipsec_cloner);
+VNET_DEFINE_STATIC(struct if_clone *, ipsec_cloner);
#define V_ipsec_cloner VNET(ipsec_cloner)
static int
diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c
index 077e93163713..1117fc73cc23 100644
--- a/sys/net/if_lagg.c
+++ b/sys/net/if_lagg.c
@@ -97,7 +97,7 @@ static struct {
VNET_DEFINE(SLIST_HEAD(__trhead, lagg_softc), lagg_list); /* list of laggs */
#define V_lagg_list VNET(lagg_list)
-static VNET_DEFINE(struct mtx, lagg_list_mtx);
+VNET_DEFINE_STATIC(struct mtx, lagg_list_mtx);
#define V_lagg_list_mtx VNET(lagg_list_mtx)
#define LAGG_LIST_LOCK_INIT(x) mtx_init(&V_lagg_list_mtx, \
"if_lagg list", NULL, MTX_DEF)
@@ -108,7 +108,7 @@ eventhandler_tag lagg_detach_cookie = NULL;
static int lagg_clone_create(struct if_clone *, int, caddr_t);
static void lagg_clone_destroy(struct ifnet *);
-static VNET_DEFINE(struct if_clone *, lagg_cloner);
+VNET_DEFINE_STATIC(struct if_clone *, lagg_cloner);
#define V_lagg_cloner VNET(lagg_cloner)
static const char laggname[] = "lagg";
@@ -249,21 +249,21 @@ SYSCTL_NODE(_net_link, OID_AUTO, lagg, CTLFLAG_RW, 0,
"Link Aggregation");
/* Allow input on any failover links */
-static VNET_DEFINE(int, lagg_failover_rx_all);
+VNET_DEFINE_STATIC(int, lagg_failover_rx_all);
#define V_lagg_failover_rx_all VNET(lagg_failover_rx_all)
SYSCTL_INT(_net_link_lagg, OID_AUTO, failover_rx_all, CTLFLAG_RW | CTLFLAG_VNET,
&VNET_NAME(lagg_failover_rx_all), 0,
"Accept input from any interface in a failover lagg");
/* Default value for using flowid */
-static VNET_DEFINE(int, def_use_flowid) = 0;
+VNET_DEFINE_STATIC(int, def_use_flowid) = 0;
#define V_def_use_flowid VNET(def_use_flowid)
SYSCTL_INT(_net_link_lagg, OID_AUTO, default_use_flowid, CTLFLAG_RWTUN,
&VNET_NAME(def_use_flowid), 0,
"Default setting for using flow id for load sharing");
/* Default value for flowid shift */
-static VNET_DEFINE(int, def_flowid_shift) = 16;
+VNET_DEFINE_STATIC(int, def_flowid_shift) = 16;
#define V_def_flowid_shift VNET(def_flowid_shift)
SYSCTL_INT(_net_link_lagg, OID_AUTO, default_flowid_shift, CTLFLAG_RWTUN,
&VNET_NAME(def_flowid_shift), 0,
diff --git a/sys/net/if_llatbl.c b/sys/net/if_llatbl.c
index 733e1634f7d4..440b21105b06 100644
--- a/sys/net/if_llatbl.c
+++ b/sys/net/if_llatbl.c
@@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$");
MALLOC_DEFINE(M_LLTABLE, "lltable", "link level address tables");
-static VNET_DEFINE(SLIST_HEAD(, lltable), lltables) =
+VNET_DEFINE_STATIC(SLIST_HEAD(, lltable), lltables) =
SLIST_HEAD_INITIALIZER(lltables);
#define V_lltables VNET(lltables)
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c
index 3be2a3721409..3c0de11c9a98 100644
--- a/sys/net/if_loop.c
+++ b/sys/net/if_loop.c
@@ -99,7 +99,7 @@ static void lo_clone_destroy(struct ifnet *);
VNET_DEFINE(struct ifnet *, loif); /* Used externally */
#ifdef VIMAGE
-static VNET_DEFINE(struct if_clone *, lo_cloner);
+VNET_DEFINE_STATIC(struct if_clone *, lo_cloner);
#define V_lo_cloner VNET(lo_cloner)
#endif
diff --git a/sys/net/if_me.c b/sys/net/if_me.c
index aa2e305fec29..d6d7245d32cf 100644
--- a/sys/net/if_me.c
+++ b/sys/net/if_me.c
@@ -94,7 +94,7 @@ CK_LIST_HEAD(me_list, me_softc);
#ifndef ME_HASH_SIZE
#define ME_HASH_SIZE (1 << 4)
#endif
-static VNET_DEFINE(struct me_list *, me_hashtbl) = NULL;
+VNET_DEFINE_STATIC(struct me_list *, me_hashtbl) = NULL;
#define V_me_hashtbl VNET(me_hashtbl)
#define ME_HASH(src, dst) (V_me_hashtbl[\
me_hashval((src), (dst)) & (ME_HASH_SIZE - 1)])
@@ -104,7 +104,7 @@ SX_SYSINIT(me_ioctl_sx, &me_ioctl_sx, "me_ioctl");
static int me_clone_create(struct if_clone *, int, caddr_t);
static void me_clone_destroy(struct ifnet *);
-static VNET_DEFINE(struct if_clone *, me_cloner);
+VNET_DEFINE_STATIC(struct if_clone *, me_cloner);
#define V_me_cloner VNET(me_cloner)
static void me_qflush(struct ifnet *);
@@ -124,7 +124,7 @@ static SYSCTL_NODE(_net_link, IFT_TUNNEL, me, CTLFLAG_RW, 0,
#define MAX_ME_NEST 1
#endif
-static VNET_DEFINE(int, max_me_nesting) = MAX_ME_NEST;
+VNET_DEFINE_STATIC(int, max_me_nesting) = MAX_ME_NEST;
#define V_max_me_nesting VNET(max_me_nesting)
SYSCTL_INT(_net_link_me, OID_AUTO, max_nesting, CTLFLAG_RW | CTLFLAG_VNET,
&VNET_NAME(max_me_nesting), 0, "Max nested tunnels");
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index 3e0a7d383ea5..1bacd76cbcdf 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -335,7 +335,7 @@ static void vlan_lladdr_fn(void *arg, int pending);
static struct if_clone *vlan_cloner;
#ifdef VIMAGE
-static VNET_DEFINE(struct if_clone *, vlan_cloner);
+VNET_DEFINE_STATIC(struct if_clone *, vlan_cloner);
#define V_vlan_cloner VNET(vlan_cloner)
#endif
diff --git a/sys/net/netisr.c b/sys/net/netisr.c
index 81965631b106..5a81fc2b3b69 100644
--- a/sys/net/netisr.c
+++ b/sys/net/netisr.c
@@ -225,7 +225,7 @@ static struct netisr_proto netisr_proto[NETISR_MAXPROT];
* mechanism to stop netisr processing for vnet teardown.
* Apart from that we expect a VNET to always be enabled.
*/
-static VNET_DEFINE(u_int, netisr_enable[NETISR_MAXPROT]);
+VNET_DEFINE_STATIC(u_int, netisr_enable[NETISR_MAXPROT]);
#define V_netisr_enable VNET(netisr_enable)
#endif
diff --git a/sys/net/route.c b/sys/net/route.c
index 399a2a9ede03..ee5a0e012a82 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -137,7 +137,7 @@ VNET_DEFINE(int, rttrash); /* routes not in table but not freed */
*/
#define RNTORT(p) ((struct rtentry *)(p))
-static VNET_DEFINE(uma_zone_t, rtzone); /* Routing table UMA zone. */
+VNET_DEFINE_STATIC(uma_zone_t, rtzone); /* Routing table UMA zone. */
#define V_rtzone VNET(rtzone)
static int rtrequest1_fib_change(struct rib_head *, struct rt_addrinfo *,
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 91c846dc8216..407764ed263f 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -140,7 +140,7 @@ typedef struct {
int ip6_count; /* attached w/ AF_INET6 */
int any_count; /* total attached */
} route_cb_t;
-static VNET_DEFINE(route_cb_t, route_cb);
+VNET_DEFINE_STATIC(route_cb_t, route_cb);
#define V_route_cb VNET(route_cb)
struct mtx rtsock_mtx;
diff --git a/sys/net/vnet.c b/sys/net/vnet.c
index 3180cee80e84..c2c725836c65 100644
--- a/sys/net/vnet.c
+++ b/sys/net/vnet.c
@@ -178,7 +178,7 @@ static MALLOC_DEFINE(M_VNET_DATA, "vnet_data", "VNET data");
* Space to store virtualized global variables from loadable kernel modules,
* and the free list to manage it.
*/
-static VNET_DEFINE(char, modspace[VNET_MODMIN]);
+VNET_DEFINE_STATIC(char, modspace[VNET_MODMIN]);
/*
* Global lists of subsystem constructor and destructors for vnets. They are
diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c
index cc5cf99912fc..88b0d090cdf0 100644
--- a/sys/netgraph/ng_base.c
+++ b/sys/netgraph/ng_base.c
@@ -179,12 +179,12 @@ static struct rwlock ng_typelist_lock;
/* Hash related definitions. */
LIST_HEAD(nodehash, ng_node);
-static VNET_DEFINE(struct nodehash *, ng_ID_hash);
-static VNET_DEFINE(u_long, ng_ID_hmask);
-static VNET_DEFINE(u_long, ng_nodes);
-static VNET_DEFINE(struct nodehash *, ng_name_hash);
-static VNET_DEFINE(u_long, ng_name_hmask);
-static VNET_DEFINE(u_long, ng_named_nodes);
+VNET_DEFINE_STATIC(struct nodehash *, ng_ID_hash);
+VNET_DEFINE_STATIC(u_long, ng_ID_hmask);
+VNET_DEFINE_STATIC(u_long, ng_nodes);
+VNET_DEFINE_STATIC(struct nodehash *, ng_name_hash);
+VNET_DEFINE_STATIC(u_long, ng_name_hmask);
+VNET_DEFINE_STATIC(u_long, ng_named_nodes);
#define V_ng_ID_hash VNET(ng_ID_hash)
#define V_ng_ID_hmask VNET(ng_ID_hmask)
#define V_ng_nodes VNET(ng_nodes)
@@ -377,7 +377,7 @@ ng_alloc_node(void)
#define TRAP_ERROR()
#endif
-static VNET_DEFINE(ng_ID_t, nextID) = 1;
+VNET_DEFINE_STATIC(ng_ID_t, nextID) = 1;
#define V_nextID VNET(nextID)
#ifdef INVARIANTS
diff --git a/sys/netgraph/ng_eiface.c b/sys/netgraph/ng_eiface.c
index fcc6baf57e1a..ab251a5686f5 100644
--- a/sys/netgraph/ng_eiface.c
+++ b/sys/netgraph/ng_eiface.c
@@ -122,7 +122,7 @@ static struct ng_type typestruct = {
};
NETGRAPH_INIT(eiface, &typestruct);
-static VNET_DEFINE(struct unrhdr *, ng_eiface_unit);
+VNET_DEFINE_STATIC(struct unrhdr *, ng_eiface_unit);
#define V_ng_eiface_unit VNET(ng_eiface_unit)
/************************************************************************
diff --git a/sys/netgraph/ng_iface.c b/sys/netgraph/ng_iface.c
index 3079f002f807..81546bd11beb 100644
--- a/sys/netgraph/ng_iface.c
+++ b/sys/netgraph/ng_iface.c
@@ -199,7 +199,7 @@ static struct ng_type typestruct = {
};
NETGRAPH_INIT(iface, &typestruct);
-static VNET_DEFINE(struct unrhdr *, ng_iface_unit);
+VNET_DEFINE_STATIC(struct unrhdr *, ng_iface_unit);
#define V_ng_iface_unit VNET(ng_iface_unit)
/************************************************************************
diff --git a/sys/netinet/cc/cc_cdg.c b/sys/netinet/cc/cc_cdg.c
index 2fd9f35c4c18..7eba2de114cd 100644
--- a/sys/netinet/cc/cc_cdg.c
+++ b/sys/netinet/cc/cc_cdg.c
@@ -205,13 +205,13 @@ static MALLOC_DEFINE(M_CDG, "cdg data",
static int ertt_id;
-static VNET_DEFINE(uint32_t, cdg_alpha_inc);
-static VNET_DEFINE(uint32_t, cdg_beta_delay);
-static VNET_DEFINE(uint32_t, cdg_beta_loss);
-static VNET_DEFINE(uint32_t, cdg_smoothing_factor);
-static VNET_DEFINE(uint32_t, cdg_exp_backoff_scale);
-static VNET_DEFINE(uint32_t, cdg_consec_cong);
-static VNET_DEFINE(uint32_t, cdg_hold_backoff);
+VNET_DEFINE_STATIC(uint32_t, cdg_alpha_inc);
+VNET_DEFINE_STATIC(uint32_t, cdg_beta_delay);
+VNET_DEFINE_STATIC(uint32_t, cdg_beta_loss);
+VNET_DEFINE_STATIC(uint32_t, cdg_smoothing_factor);
+VNET_DEFINE_STATIC(uint32_t, cdg_exp_backoff_scale);
+VNET_DEFINE_STATIC(uint32_t, cdg_consec_cong);
+VNET_DEFINE_STATIC(uint32_t, cdg_hold_backoff);
#define V_cdg_alpha_inc VNET(cdg_alpha_inc)
#define V_cdg_beta_delay VNET(cdg_beta_delay)
#define V_cdg_beta_loss VNET(cdg_beta_loss)
diff --git a/sys/netinet/cc/cc_chd.c b/sys/netinet/cc/cc_chd.c
index 43e7f7c41d8d..ea674a7dc3c9 100644
--- a/sys/netinet/cc/cc_chd.c
+++ b/sys/netinet/cc/cc_chd.c
@@ -117,11 +117,11 @@ struct chd {
static int ertt_id;
-static VNET_DEFINE(uint32_t, chd_qmin) = 5;
-static VNET_DEFINE(uint32_t, chd_pmax) = 50;
-static VNET_DEFINE(uint32_t, chd_loss_fair) = 1;
-static VNET_DEFINE(uint32_t, chd_use_max) = 1;
-static VNET_DEFINE(uint32_t, chd_qthresh) = 20;
+VNET_DEFINE_STATIC(uint32_t, chd_qmin) = 5;
+VNET_DEFINE_STATIC(uint32_t, chd_pmax) = 50;
+VNET_DEFINE_STATIC(uint32_t, chd_loss_fair) = 1;
+VNET_DEFINE_STATIC(uint32_t, chd_use_max) = 1;
+VNET_DEFINE_STATIC(uint32_t, chd_qthresh) = 20;
#define V_chd_qthresh VNET(chd_qthresh)
#define V_chd_qmin VNET(chd_qmin)
#define V_chd_pmax VNET(chd_pmax)
diff --git a/sys/netinet/cc/cc_dctcp.c b/sys/netinet/cc/cc_dctcp.c
index 2ed8aed97640..d5ba61ace212 100644
--- a/sys/netinet/cc/cc_dctcp.c
+++ b/sys/netinet/cc/cc_dctcp.c
@@ -59,11 +59,11 @@ __FBSDID("$FreeBSD$");
#define CAST_PTR_INT(X) (*((int*)(X)))
#define MAX_ALPHA_VALUE 1024
-static VNET_DEFINE(uint32_t, dctcp_alpha) = 0;
+VNET_DEFINE_STATIC(uint32_t, dctcp_alpha) = 0;
#define V_dctcp_alpha VNET(dctcp_alpha)
-static VNET_DEFINE(uint32_t, dctcp_shift_g) = 4;
+VNET_DEFINE_STATIC(uint32_t, dctcp_shift_g) = 4;
#define V_dctcp_shift_g VNET(dctcp_shift_g)
-static VNET_DEFINE(uint32_t, dctcp_slowstart) = 0;
+VNET_DEFINE_STATIC(uint32_t, dctcp_slowstart) = 0;
#define V_dctcp_slowstart VNET(dctcp_slowstart)
struct dctcp {
diff --git a/sys/netinet/cc/cc_hd.c b/sys/netinet/cc/cc_hd.c
index 4273f5eddd68..790345dde79c 100644
--- a/sys/netinet/cc/cc_hd.c
+++ b/sys/netinet/cc/cc_hd.c
@@ -89,9 +89,9 @@ static int hd_mod_init(void);
static int ertt_id;
-static VNET_DEFINE(uint32_t, hd_qthresh) = 20;
-static VNET_DEFINE(uint32_t, hd_qmin) = 5;
-static VNET_DEFINE(uint32_t, hd_pmax) = 5;
+VNET_DEFINE_STATIC(uint32_t, hd_qthresh) = 20;
+VNET_DEFINE_STATIC(uint32_t, hd_qmin) = 5;
+VNET_DEFINE_STATIC(uint32_t, hd_pmax) = 5;
#define V_hd_qthresh VNET(hd_qthresh)
#define V_hd_qmin VNET(hd_qmin)
#define V_hd_pmax VNET(hd_pmax)
diff --git a/sys/netinet/cc/cc_htcp.c b/sys/netinet/cc/cc_htcp.c
index bb69bb5ab6d7..30962485a3e7 100644
--- a/sys/netinet/cc/cc_htcp.c
+++ b/sys/netinet/cc/cc_htcp.c
@@ -170,8 +170,8 @@ static int htcp_rtt_ref;
static int htcp_max_diff = INT_MAX / ((1 << HTCP_ALPHA_INC_SHIFT) * 10);
/* Per-netstack vars. */
-static VNET_DEFINE(u_int, htcp_adaptive_backoff) = 0;
-static VNET_DEFINE(u_int, htcp_rtt_scaling) = 0;
+VNET_DEFINE_STATIC(u_int, htcp_adaptive_backoff) = 0;
+VNET_DEFINE_STATIC(u_int, htcp_rtt_scaling) = 0;
#define V_htcp_adaptive_backoff VNET(htcp_adaptive_backoff)
#define V_htcp_rtt_scaling VNET(htcp_rtt_scaling)
diff --git a/sys/netinet/cc/cc_newreno.c b/sys/netinet/cc/cc_newreno.c
index 0ecbbbe72f28..8484d65e9874 100644
--- a/sys/netinet/cc/cc_newreno.c
+++ b/sys/netinet/cc/cc_newreno.c
@@ -88,8 +88,8 @@ static void newreno_cong_signal(struct cc_var *ccv, uint32_t type);
static void newreno_post_recovery(struct cc_var *ccv);
static int newreno_ctl_output(struct cc_var *ccv, struct sockopt *sopt, void *buf);
-static VNET_DEFINE(uint32_t, newreno_beta) = 50;
-static VNET_DEFINE(uint32_t, newreno_beta_ecn) = 80;
+VNET_DEFINE_STATIC(uint32_t, newreno_beta) = 50;
+VNET_DEFINE_STATIC(uint32_t, newreno_beta_ecn) = 80;
#define V_newreno_beta VNET(newreno_beta)
#define V_newreno_beta_ecn VNET(newreno_beta_ecn)
diff --git a/sys/netinet/cc/cc_vegas.c b/sys/netinet/cc/cc_vegas.c
index 768c1cb9f143..94346727ff1e 100644
--- a/sys/netinet/cc/cc_vegas.c
+++ b/sys/netinet/cc/cc_vegas.c
@@ -100,8 +100,8 @@ struct vegas {
static int32_t ertt_id;
-static VNET_DEFINE(uint32_t, vegas_alpha) = 1;
-static VNET_DEFINE(uint32_t, vegas_beta) = 3;
+VNET_DEFINE_STATIC(uint32_t, vegas_alpha) = 1;
+VNET_DEFINE_STATIC(uint32_t, vegas_beta) = 3;
#define V_vegas_alpha VNET(vegas_alpha)
#define V_vegas_beta VNET(vegas_beta)
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index 3c59045ffbd9..0d6b6f551e24 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -94,13 +94,13 @@ static SYSCTL_NODE(_net_link_ether, PF_INET, inet, CTLFLAG_RW, 0, "");
static SYSCTL_NODE(_net_link_ether, PF_ARP, arp, CTLFLAG_RW, 0, "");
/* timer values */
-static VNET_DEFINE(int, arpt_keep) = (20*60); /* once resolved, good for 20
+VNET_DEFINE_STATIC(int, arpt_keep) = (20*60); /* once resolved, good for 20
* minutes */
-static VNET_DEFINE(int, arp_maxtries) = 5;
-static VNET_DEFINE(int, arp_proxyall) = 0;
-static VNET_DEFINE(int, arpt_down) = 20; /* keep incomplete entries for
+VNET_DEFINE_STATIC(int, arp_maxtries) = 5;
+VNET_DEFINE_STATIC(int, arp_proxyall) = 0;
+VNET_DEFINE_STATIC(int, arpt_down) = 20; /* keep incomplete entries for
* 20 seconds */
-static VNET_DEFINE(int, arpt_rexmit) = 1; /* retransmit arp entries, sec*/
+VNET_DEFINE_STATIC(int, arpt_rexmit) = 1; /* retransmit arp entries, sec*/
VNET_PCPUSTAT_DEFINE(struct arpstat, arpstat); /* ARP statistics, see if_arp.h */
VNET_PCPUSTAT_SYSINIT(arpstat);
@@ -108,7 +108,7 @@ VNET_PCPUSTAT_SYSINIT(arpstat);
VNET_PCPUSTAT_SYSUNINIT(arpstat);
#endif /* VIMAGE */
-static VNET_DEFINE(int, arp_maxhold) = 1;
+VNET_DEFINE_STATIC(int, arp_maxhold) = 1;
#define V_arpt_keep VNET(arpt_keep)
#define V_arpt_down VNET(arpt_down)
diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c
index 55545aacf906..27c478382ef3 100644
--- a/sys/netinet/igmp.c
+++ b/sys/netinet/igmp.c
@@ -217,11 +217,11 @@ static MALLOC_DEFINE(M_IGMP, "igmp", "igmp state");
* FUTURE: Stop using IFP_TO_IA/INADDR_ANY, and use source address selection
* policy to control the address used by IGMP on the link.
*/
-static VNET_DEFINE(int, interface_timers_running); /* IGMPv3 general
+VNET_DEFINE_STATIC(int, interface_timers_running); /* IGMPv3 general
* query response */
-static VNET_DEFINE(int, state_change_timers_running); /* IGMPv3 state-change
+VNET_DEFINE_STATIC(int, state_change_timers_running); /* IGMPv3 state-change
* retransmit */
-static VNET_DEFINE(int, current_state_timers_running); /* IGMPv1/v2 host
+VNET_DEFINE_STATIC(int, current_state_timers_running); /* IGMPv1/v2 host
* report; IGMPv3 g/sg
* query response */
@@ -229,25 +229,25 @@ static VNET_DEFINE(int, current_state_timers_running); /* IGMPv1/v2 host
#define V_state_change_timers_running VNET(state_change_timers_running)
#define V_current_state_timers_running VNET(current_state_timers_running)
-static VNET_DEFINE(LIST_HEAD(, igmp_ifsoftc), igi_head) =
+VNET_DEFINE_STATIC(LIST_HEAD(, igmp_ifsoftc), igi_head) =
LIST_HEAD_INITIALIZER(igi_head);
-static VNET_DEFINE(struct igmpstat, igmpstat) = {
+VNET_DEFINE_STATIC(struct igmpstat, igmpstat) = {
.igps_version = IGPS_VERSION_3,
.igps_len = sizeof(struct igmpstat),
};
-static VNET_DEFINE(struct timeval, igmp_gsrdelay) = {10, 0};
+VNET_DEFINE_STATIC(struct timeval, igmp_gsrdelay) = {10, 0};
#define V_igi_head VNET(igi_head)
#define V_igmpstat VNET(igmpstat)
#define V_igmp_gsrdelay VNET(igmp_gsrdelay)
-static VNET_DEFINE(int, igmp_recvifkludge) = 1;
-static VNET_DEFINE(int, igmp_sendra) = 1;
-static VNET_DEFINE(int, igmp_sendlocal) = 1;
-static VNET_DEFINE(int, igmp_v1enable) = 1;
-static VNET_DEFINE(int, igmp_v2enable) = 1;
-static VNET_DEFINE(int, igmp_legacysupp);
-static VNET_DEFINE(int, igmp_default_version) = IGMP_VERSION_3;
+VNET_DEFINE_STATIC(int, igmp_recvifkludge) = 1;
+VNET_DEFINE_STATIC(int, igmp_sendra) = 1;
+VNET_DEFINE_STATIC(int, igmp_sendlocal) = 1;
+VNET_DEFINE_STATIC(int, igmp_v1enable) = 1;
+VNET_DEFINE_STATIC(int, igmp_v2enable) = 1;
+VNET_DEFINE_STATIC(int, igmp_legacysupp);
+VNET_DEFINE_STATIC(int, igmp_default_version) = IGMP_VERSION_3;
#define V_igmp_recvifkludge VNET(igmp_recvifkludge)
#define V_igmp_sendra VNET(igmp_sendra)
diff --git a/sys/netinet/in.c b/sys/netinet/in.c
index a3c5338f4dbf..5fc32425d82d 100644
--- a/sys/netinet/in.c
+++ b/sys/netinet/in.c
@@ -78,7 +78,7 @@ static int in_difaddr_ioctl(u_long, caddr_t, struct ifnet *, struct thread *);
static void in_socktrim(struct sockaddr_in *);
static void in_purgemaddrs(struct ifnet *);
-static VNET_DEFINE(int, nosameprefix);
+VNET_DEFINE_STATIC(int, nosameprefix);
#define V_nosameprefix VNET(nosameprefix)
SYSCTL_INT(_net_inet_ip, OID_AUTO, no_same_prefix, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(nosameprefix), 0,
diff --git a/sys/netinet/in_gif.c b/sys/netinet/in_gif.c
index 4b609294cbe8..767d6479978a 100644
--- a/sys/netinet/in_gif.c
+++ b/sys/netinet/in_gif.c
@@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$");
#include <net/if_gif.h>
#define GIF_TTL 30
-static VNET_DEFINE(int, ip_gif_ttl) = GIF_TTL;
+VNET_DEFINE_STATIC(int, ip_gif_ttl) = GIF_TTL;
#define V_ip_gif_ttl VNET(ip_gif_ttl)
SYSCTL_INT(_net_inet_ip, IPCTL_GIF_TTL, gifttl, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(ip_gif_ttl), 0, "Default TTL value for encapsulated packets");
@@ -81,8 +81,8 @@ SYSCTL_INT(_net_inet_ip, IPCTL_GIF_TTL, gifttl, CTLFLAG_VNET | CTLFLAG_RW,
* We keep interfaces in a hash table using src+dst as key.
* Interfaces with GIF_IGNORE_SOURCE flag are linked into plain list.
*/
-static VNET_DEFINE(struct gif_list *, ipv4_hashtbl) = NULL;
-static VNET_DEFINE(struct gif_list, ipv4_list) = CK_LIST_HEAD_INITIALIZER();
+VNET_DEFINE_STATIC(struct gif_list *, ipv4_hashtbl) = NULL;
+VNET_DEFINE_STATIC(struct gif_list, ipv4_list) = CK_LIST_HEAD_INITIALIZER();
#define V_ipv4_hashtbl VNET(ipv4_hashtbl)
#define V_ipv4_list VNET(ipv4_list)
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index 8a04c0783a85..1967fda3c881 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -138,7 +138,7 @@ VNET_DEFINE(int, ipport_randomcps) = 10; /* user controlled via sysctl */
VNET_DEFINE(int, ipport_randomtime) = 45; /* user controlled via sysctl */
VNET_DEFINE(int, ipport_stoprandom); /* toggled by ipport_tick */
VNET_DEFINE(int, ipport_tcpallocs);
-static VNET_DEFINE(int, ipport_tcplastcount);
+VNET_DEFINE_STATIC(int, ipport_tcplastcount);
#define V_ipport_tcplastcount VNET(ipport_tcplastcount)
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index 50ad563b639a..34dc7ca39b80 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -187,31 +187,31 @@ static int proto_reg[] = {-1, -1};
*/
/* Accept incoming CARP packets. */
-static VNET_DEFINE(int, carp_allow) = 1;
+VNET_DEFINE_STATIC(int, carp_allow) = 1;
#define V_carp_allow VNET(carp_allow)
/* Set DSCP in outgoing CARP packets. */
-static VNET_DEFINE(int, carp_dscp) = 56;
+VNET_DEFINE_STATIC(int, carp_dscp) = 56;
#define V_carp_dscp VNET(carp_dscp)
/* Preempt slower nodes. */
-static VNET_DEFINE(int, carp_preempt) = 0;
+VNET_DEFINE_STATIC(int, carp_preempt) = 0;
#define V_carp_preempt VNET(carp_preempt)
/* Log level. */
-static VNET_DEFINE(int, carp_log) = 1;
+VNET_DEFINE_STATIC(int, carp_log) = 1;
#define V_carp_log VNET(carp_log)
/* Global advskew demotion. */
-static VNET_DEFINE(int, carp_demotion) = 0;
+VNET_DEFINE_STATIC(int, carp_demotion) = 0;
#define V_carp_demotion VNET(carp_demotion)
/* Send error demotion factor. */
-static VNET_DEFINE(int, carp_senderr_adj) = CARP_MAXSKEW;
+VNET_DEFINE_STATIC(int, carp_senderr_adj) = CARP_MAXSKEW;
#define V_carp_senderr_adj VNET(carp_senderr_adj)
/* Iface down demotion factor. */
-static VNET_DEFINE(int, carp_ifdown_adj) = CARP_MAXSKEW;
+VNET_DEFINE_STATIC(int, carp_ifdown_adj) = CARP_MAXSKEW;
#define V_carp_ifdown_adj VNET(carp_ifdown_adj)
static int carp_allow_sysctl(SYSCTL_HANDLER_ARGS);
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c
index 9c42c8838642..e96c8135e5da 100644
--- a/sys/netinet/ip_divert.c
+++ b/sys/netinet/ip_divert.c
@@ -111,8 +111,8 @@ __FBSDID("$FreeBSD$");
*/
/* Internal variables. */
-static VNET_DEFINE(struct inpcbhead, divcb);
-static VNET_DEFINE(struct inpcbinfo, divcbinfo);
+VNET_DEFINE_STATIC(struct inpcbhead, divcb);
+VNET_DEFINE_STATIC(struct inpcbinfo, divcbinfo);
#define V_divcb VNET(divcb)
#define V_divcbinfo VNET(divcbinfo)
diff --git a/sys/netinet/ip_gre.c b/sys/netinet/ip_gre.c
index 4a7184ce3f31..08e47c181c78 100644
--- a/sys/netinet/ip_gre.c
+++ b/sys/netinet/ip_gre.c
@@ -74,7 +74,7 @@ VNET_DEFINE(int, ip_gre_ttl) = GRE_TTL;
SYSCTL_INT(_net_inet_ip, OID_AUTO, grettl, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(ip_gre_ttl), 0, "Default TTL value for encapsulated packets");
-static VNET_DEFINE(struct gre_list *, ipv4_hashtbl) = NULL;
+VNET_DEFINE_STATIC(struct gre_list *, ipv4_hashtbl) = NULL;
#define V_ipv4_hashtbl VNET(ipv4_hashtbl)
#define GRE_HASH(src, dst) (V_ipv4_hashtbl[\
in_gre_hashval((src), (dst)) & (GRE_HASH_SIZE - 1)])
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
index 169b93753bb5..3f07c4e19510 100644
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -82,13 +82,13 @@ __FBSDID("$FreeBSD$");
* routines to turnaround packets back to the originator, and
* host table maintenance routines.
*/
-static VNET_DEFINE(int, icmplim) = 200;
+VNET_DEFINE_STATIC(int, icmplim) = 200;
#define V_icmplim VNET(icmplim)
SYSCTL_INT(_net_inet_icmp, ICMPCTL_ICMPLIM, icmplim, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(icmplim), 0,
"Maximum number of ICMP responses per second");
-static VNET_DEFINE(int, icmplim_output) = 1;
+VNET_DEFINE_STATIC(int, icmplim_output) = 1;
#define V_icmplim_output VNET(icmplim_output)
SYSCTL_INT(_net_inet_icmp, OID_AUTO, icmplim_output, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(icmplim_output), 0,
@@ -104,13 +104,13 @@ SYSCTL_VNET_PCPUSTAT(_net_inet_icmp, ICMPCTL_STATS, stats, struct icmpstat,
VNET_PCPUSTAT_SYSUNINIT(icmpstat);
#endif /* VIMAGE */
-static VNET_DEFINE(int, icmpmaskrepl) = 0;
+VNET_DEFINE_STATIC(int, icmpmaskrepl) = 0;
#define V_icmpmaskrepl VNET(icmpmaskrepl)
SYSCTL_INT(_net_inet_icmp, ICMPCTL_MASKREPL, maskrepl, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(icmpmaskrepl), 0,
"Reply to ICMP Address Mask Request packets");
-static VNET_DEFINE(u_int, icmpmaskfake) = 0;
+VNET_DEFINE_STATIC(u_int, icmpmaskfake) = 0;
#define V_icmpmaskfake VNET(icmpmaskfake)
SYSCTL_UINT(_net_inet_icmp, OID_AUTO, maskfake, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(icmpmaskfake), 0,
@@ -122,37 +122,37 @@ SYSCTL_INT(_net_inet_icmp, OID_AUTO, drop_redirect, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(drop_redirect), 0,
"Ignore ICMP redirects");
-static VNET_DEFINE(int, log_redirect) = 0;
+VNET_DEFINE_STATIC(int, log_redirect) = 0;
#define V_log_redirect VNET(log_redirect)
SYSCTL_INT(_net_inet_icmp, OID_AUTO, log_redirect, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(log_redirect), 0,
"Log ICMP redirects to the console");
-static VNET_DEFINE(char, reply_src[IFNAMSIZ]);
+VNET_DEFINE_STATIC(char, reply_src[IFNAMSIZ]);
#define V_reply_src VNET(reply_src)
SYSCTL_STRING(_net_inet_icmp, OID_AUTO, reply_src, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(reply_src), IFNAMSIZ,
"ICMP reply source for non-local packets");
-static VNET_DEFINE(int, icmp_rfi) = 0;
+VNET_DEFINE_STATIC(int, icmp_rfi) = 0;
#define V_icmp_rfi VNET(icmp_rfi)
SYSCTL_INT(_net_inet_icmp, OID_AUTO, reply_from_interface, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(icmp_rfi), 0,
"ICMP reply from incoming interface for non-local packets");
/* Router requirements RFC 1812 section 4.3.2.3 requires 576 - 28. */
-static VNET_DEFINE(int, icmp_quotelen) = 548;
+VNET_DEFINE_STATIC(int, icmp_quotelen) = 8;
#define V_icmp_quotelen VNET(icmp_quotelen)
SYSCTL_INT(_net_inet_icmp, OID_AUTO, quotelen, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(icmp_quotelen), 0,
"Number of bytes from original packet to quote in ICMP reply");
-static VNET_DEFINE(int, icmpbmcastecho) = 0;
+VNET_DEFINE_STATIC(int, icmpbmcastecho) = 0;
#define V_icmpbmcastecho VNET(icmpbmcastecho)
SYSCTL_INT(_net_inet_icmp, OID_AUTO, bmcastecho, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(icmpbmcastecho), 0,
"Reply to multicast ICMP Echo Request and Timestamp packets");
-static VNET_DEFINE(int, icmptstamprepl) = 1;
+VNET_DEFINE_STATIC(int, icmptstamprepl) = 1;
#define V_icmptstamprepl VNET(icmptstamprepl)
SYSCTL_INT(_net_inet_icmp, OID_AUTO, tstamprepl, CTLFLAG_RW,
&VNET_NAME(icmptstamprepl), 0,
@@ -1001,7 +1001,7 @@ struct icmp_rate {
const char *descr;
struct counter_rate cr;
};
-static VNET_DEFINE(struct icmp_rate, icmp_rates[BANDLIM_MAX]) = {
+VNET_DEFINE_STATIC(struct icmp_rate, icmp_rates[BANDLIM_MAX]) = {
{ "icmp unreach response" },
{ "icmp ping response" },
{ "icmp tstamp response" },
diff --git a/sys/netinet/ip_id.c b/sys/netinet/ip_id.c
index ba8cb2d49457..d124d541442a 100644
--- a/sys/netinet/ip_id.c
+++ b/sys/netinet/ip_id.c
@@ -98,8 +98,8 @@ __FBSDID("$FreeBSD$");
* suggested by RFC6864. We use per-CPU counter for that, or if
* user wants to, we can turn on random ID generation.
*/
-static VNET_DEFINE(int, ip_rfc6864) = 1;
-static VNET_DEFINE(int, ip_do_randomid) = 0;
+VNET_DEFINE_STATIC(int, ip_rfc6864) = 1;
+VNET_DEFINE_STATIC(int, ip_do_randomid) = 0;
#define V_ip_rfc6864 VNET(ip_rfc6864)
#define V_ip_do_randomid VNET(ip_do_randomid)
@@ -107,13 +107,13 @@ static VNET_DEFINE(int, ip_do_randomid) = 0;
* Random ID state engine.
*/
static MALLOC_DEFINE(M_IPID, "ipid", "randomized ip id state");
-static VNET_DEFINE(uint16_t *, id_array);
-static VNET_DEFINE(bitstr_t *, id_bits);
-static VNET_DEFINE(int, array_ptr);
-static VNET_DEFINE(int, array_size);
-static VNET_DEFINE(int, random_id_collisions);
-static VNET_DEFINE(int, random_id_total);
-static VNET_DEFINE(struct mtx, ip_id_mtx);
+VNET_DEFINE_STATIC(uint16_t *, id_array);
+VNET_DEFINE_STATIC(bitstr_t *, id_bits);
+VNET_DEFINE_STATIC(int, array_ptr);
+VNET_DEFINE_STATIC(int, array_size);
+VNET_DEFINE_STATIC(int, random_id_collisions);
+VNET_DEFINE_STATIC(int, random_id_total);
+VNET_DEFINE_STATIC(struct mtx, ip_id_mtx);
#define V_id_array VNET(id_array)
#define V_id_bits VNET(id_bits)
#define V_array_ptr VNET(array_ptr)
@@ -125,7 +125,7 @@ static VNET_DEFINE(struct mtx, ip_id_mtx);
/*
* Non-random ID state engine is simply a per-cpu counter.
*/
-static VNET_DEFINE(counter_u64_t, ip_id);
+VNET_DEFINE_STATIC(counter_u64_t, ip_id);
#define V_ip_id VNET(ip_id)
static int sysctl_ip_randomid(SYSCTL_HANDLER_ARGS);
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index 94ebf22cd6b0..fcdeff9cb338 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -109,7 +109,7 @@ SYSCTL_INT(_net_inet_ip, IPCTL_FORWARDING, forwarding, CTLFLAG_VNET | CTLFLAG_RW
&VNET_NAME(ipforwarding), 0,
"Enable IP forwarding between interfaces");
-static VNET_DEFINE(int, ipsendredirects) = 1; /* XXX */
+VNET_DEFINE_STATIC(int, ipsendredirects) = 1; /* XXX */
#define V_ipsendredirects VNET(ipsendredirects)
SYSCTL_INT(_net_inet_ip, IPCTL_SENDREDIRECTS, redirect, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(ipsendredirects), 0,
@@ -128,7 +128,7 @@ SYSCTL_INT(_net_inet_ip, IPCTL_SENDREDIRECTS, redirect, CTLFLAG_VNET | CTLFLAG_R
* to the loopback interface instead of the interface where the
* packets for those addresses are received.
*/
-static VNET_DEFINE(int, ip_checkinterface);
+VNET_DEFINE_STATIC(int, ip_checkinterface);
#define V_ip_checkinterface VNET(ip_checkinterface)
SYSCTL_INT(_net_inet_ip, OID_AUTO, check_interface, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(ip_checkinterface), 0,
@@ -1347,7 +1347,7 @@ makedummy:
* locking. This code remains in ip_input.c as ip_mroute.c is optionally
* compiled.
*/
-static VNET_DEFINE(int, ip_rsvp_on);
+VNET_DEFINE_STATIC(int, ip_rsvp_on);
VNET_DEFINE(struct socket *, ip_rsvpd);
#define V_ip_rsvp_on VNET(ip_rsvp_on)
diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c
index ee747baa8bcc..716988ea33b1 100644
--- a/sys/netinet/ip_mroute.c
+++ b/sys/netinet/ip_mroute.c
@@ -125,7 +125,7 @@ __FBSDID("$FreeBSD$");
#define VIFI_INVALID ((vifi_t) -1)
-static VNET_DEFINE(uint32_t, last_tv_sec); /* last time we processed this */
+VNET_DEFINE_STATIC(uint32_t, last_tv_sec); /* last time we processed this */
#define V_last_tv_sec VNET(last_tv_sec)
static MALLOC_DEFINE(M_MRTABLE, "mroutetbl", "multicast forwarding cache");
@@ -149,14 +149,14 @@ static struct mtx mrouter_mtx;
static int ip_mrouter_cnt; /* # of vnets with active mrouters */
static int ip_mrouter_unloading; /* Allow no more V_ip_mrouter sockets */
-static VNET_PCPUSTAT_DEFINE(struct mrtstat, mrtstat);
+VNET_PCPUSTAT_DEFINE_STATIC(struct mrtstat, mrtstat);
VNET_PCPUSTAT_SYSINIT(mrtstat);
VNET_PCPUSTAT_SYSUNINIT(mrtstat);
SYSCTL_VNET_PCPUSTAT(_net_inet_ip, OID_AUTO, mrtstat, struct mrtstat,
mrtstat, "IPv4 Multicast Forwarding Statistics (struct mrtstat, "
"netinet/ip_mroute.h)");
-static VNET_DEFINE(u_long, mfchash);
+VNET_DEFINE_STATIC(u_long, mfchash);
#define V_mfchash VNET(mfchash)
#define MFCHASH(a, g) \
((((a).s_addr >> 20) ^ ((a).s_addr >> 10) ^ (a).s_addr ^ \
@@ -164,9 +164,9 @@ static VNET_DEFINE(u_long, mfchash);
#define MFCHASHSIZE 256
static u_long mfchashsize; /* Hash size */
-static VNET_DEFINE(u_char *, nexpire); /* 0..mfchashsize-1 */
+VNET_DEFINE_STATIC(u_char *, nexpire); /* 0..mfchashsize-1 */
#define V_nexpire VNET(nexpire)
-static VNET_DEFINE(LIST_HEAD(mfchashhdr, mfc)*, mfchashtbl);
+VNET_DEFINE_STATIC(LIST_HEAD(mfchashhdr, mfc)*, mfchashtbl);
#define V_mfchashtbl VNET(mfchashtbl)
static struct mtx mfc_mtx;
@@ -177,9 +177,9 @@ static struct mtx mfc_mtx;
mtx_init(&mfc_mtx, "IPv4 multicast forwarding cache", NULL, MTX_DEF)
#define MFC_LOCK_DESTROY() mtx_destroy(&mfc_mtx)
-static VNET_DEFINE(vifi_t, numvifs);
+VNET_DEFINE_STATIC(vifi_t, numvifs);
#define V_numvifs VNET(numvifs)
-static VNET_DEFINE(struct vif, viftable[MAXVIFS]);
+VNET_DEFINE_STATIC(struct vif, viftable[MAXVIFS]);
#define V_viftable VNET(viftable)
SYSCTL_OPAQUE(_net_inet_ip, OID_AUTO, viftable, CTLFLAG_VNET | CTLFLAG_RD,
&VNET_NAME(viftable), sizeof(V_viftable), "S,vif[MAXVIFS]",
@@ -195,7 +195,7 @@ static struct mtx vif_mtx;
static eventhandler_tag if_detach_event_tag = NULL;
-static VNET_DEFINE(struct callout, expire_upcalls_ch);
+VNET_DEFINE_STATIC(struct callout, expire_upcalls_ch);
#define V_expire_upcalls_ch VNET(expire_upcalls_ch)
#define EXPIRE_TIMEOUT (hz / 4) /* 4x / second */
@@ -210,9 +210,9 @@ static MALLOC_DEFINE(M_BWMETER, "bwmeter", "multicast upcall bw meters");
* expiration time. Periodically, the entries are analysed and processed.
*/
#define BW_METER_BUCKETS 1024
-static VNET_DEFINE(struct bw_meter*, bw_meter_timers[BW_METER_BUCKETS]);
+VNET_DEFINE_STATIC(struct bw_meter*, bw_meter_timers[BW_METER_BUCKETS]);
#define V_bw_meter_timers VNET(bw_meter_timers)
-static VNET_DEFINE(struct callout, bw_meter_ch);
+VNET_DEFINE_STATIC(struct callout, bw_meter_ch);
#define V_bw_meter_ch VNET(bw_meter_ch)
#define BW_METER_PERIOD (hz) /* periodical handling of bw meters */
@@ -220,16 +220,16 @@ static VNET_DEFINE(struct callout, bw_meter_ch);
* Pending upcalls are stored in a vector which is flushed when
* full, or periodically
*/
-static VNET_DEFINE(struct bw_upcall, bw_upcalls[BW_UPCALLS_MAX]);
+VNET_DEFINE_STATIC(struct bw_upcall, bw_upcalls[BW_UPCALLS_MAX]);
#define V_bw_upcalls VNET(bw_upcalls)
-static VNET_DEFINE(u_int, bw_upcalls_n); /* # of pending upcalls */
+VNET_DEFINE_STATIC(u_int, bw_upcalls_n); /* # of pending upcalls */
#define V_bw_upcalls_n VNET(bw_upcalls_n)
-static VNET_DEFINE(struct callout, bw_upcalls_ch);
+VNET_DEFINE_STATIC(struct callout, bw_upcalls_ch);
#define V_bw_upcalls_ch VNET(bw_upcalls_ch)
#define BW_UPCALLS_PERIOD (hz) /* periodical flush of bw upcalls */
-static VNET_PCPUSTAT_DEFINE(struct pimstat, pimstat);
+VNET_PCPUSTAT_DEFINE_STATIC(struct pimstat, pimstat);
VNET_PCPUSTAT_SYSINIT(pimstat);
VNET_PCPUSTAT_SYSUNINIT(pimstat);
@@ -297,9 +297,9 @@ static struct pim_encap_pimhdr pim_encap_pimhdr = {
0 /* flags */
};
-static VNET_DEFINE(vifi_t, reg_vif_num) = VIFI_INVALID;
+VNET_DEFINE_STATIC(vifi_t, reg_vif_num) = VIFI_INVALID;
#define V_reg_vif_num VNET(reg_vif_num)
-static VNET_DEFINE(struct ifnet, multicast_register_if);
+VNET_DEFINE_STATIC(struct ifnet, multicast_register_if);
#define V_multicast_register_if VNET(multicast_register_if)
/*
@@ -368,9 +368,9 @@ static const uint32_t mrt_api_support = (MRT_MFC_FLAGS_DISABLE_WRONGVIF |
MRT_MFC_FLAGS_BORDER_VIF |
MRT_MFC_RP |
MRT_MFC_BW_UPCALL);
-static VNET_DEFINE(uint32_t, mrt_api_config);
+VNET_DEFINE_STATIC(uint32_t, mrt_api_config);
#define V_mrt_api_config VNET(mrt_api_config)
-static VNET_DEFINE(int, pim_assert_enabled);
+VNET_DEFINE_STATIC(int, pim_assert_enabled);
#define V_pim_assert_enabled VNET(pim_assert_enabled)
static struct timeval pim_assert_interval = { 3, 0 }; /* Rate limit */
diff --git a/sys/netinet/ip_options.c b/sys/netinet/ip_options.c
index dd0914acb0b9..c194b258f476 100644
--- a/sys/netinet/ip_options.c
+++ b/sys/netinet/ip_options.c
@@ -68,13 +68,13 @@ __FBSDID("$FreeBSD$");
#include <sys/socketvar.h>
-static VNET_DEFINE(int, ip_dosourceroute);
+VNET_DEFINE_STATIC(int, ip_dosourceroute);
SYSCTL_INT(_net_inet_ip, IPCTL_SOURCEROUTE, sourceroute,
CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_dosourceroute), 0,
"Enable forwarding source routed IP packets");
#define V_ip_dosourceroute VNET(ip_dosourceroute)
-static VNET_DEFINE(int, ip_acceptsourceroute);
+VNET_DEFINE_STATIC(int, ip_acceptsourceroute);
SYSCTL_INT(_net_inet_ip, IPCTL_ACCEPTSOURCEROUTE, accept_sourceroute,
CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_acceptsourceroute), 0,
"Enable accepting source routed IP packets");
diff --git a/sys/netinet/ip_reass.c b/sys/netinet/ip_reass.c
index 6e83800ee7ea..6dc4e921c644 100644
--- a/sys/netinet/ip_reass.c
+++ b/sys/netinet/ip_reass.c
@@ -72,9 +72,9 @@ struct ipqbucket {
struct mtx lock;
};
-static VNET_DEFINE(struct ipqbucket, ipq[IPREASS_NHASH]);
+VNET_DEFINE_STATIC(struct ipqbucket, ipq[IPREASS_NHASH]);
#define V_ipq VNET(ipq)
-static VNET_DEFINE(uint32_t, ipq_hashseed);
+VNET_DEFINE_STATIC(uint32_t, ipq_hashseed);
#define V_ipq_hashseed VNET(ipq_hashseed)
#define IPQ_LOCK(i) mtx_lock(&V_ipq[i].lock)
@@ -110,7 +110,7 @@ ipq_drop(struct ipqhead *head, struct ipq *fp)
ipq_free(head, fp);
}
-static VNET_DEFINE(uma_zone_t, ipq_zone);
+VNET_DEFINE_STATIC(uma_zone_t, ipq_zone);
#define V_ipq_zone VNET(ipq_zone)
SYSCTL_PROC(_net_inet_ip, OID_AUTO, maxfragpackets, CTLFLAG_VNET |
CTLTYPE_INT | CTLFLAG_RW, NULL, 0, sysctl_maxfragpackets, "I",
@@ -119,10 +119,10 @@ SYSCTL_UMA_CUR(_net_inet_ip, OID_AUTO, fragpackets, CTLFLAG_VNET,
&VNET_NAME(ipq_zone),
"Current number of IPv4 fragment reassembly queue entries");
-static VNET_DEFINE(int, noreass);
+VNET_DEFINE_STATIC(int, noreass);
#define V_noreass VNET(noreass)
-static VNET_DEFINE(int, maxfragsperpacket);
+VNET_DEFINE_STATIC(int, maxfragsperpacket);
#define V_maxfragsperpacket VNET(maxfragsperpacket)
SYSCTL_INT(_net_inet_ip, OID_AUTO, maxfragsperpacket, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(maxfragsperpacket), 0,
diff --git a/sys/netinet/tcp_fastopen.c b/sys/netinet/tcp_fastopen.c
index 2f5ef2c797fc..396b1c9c3d01 100644
--- a/sys/netinet/tcp_fastopen.c
+++ b/sys/netinet/tcp_fastopen.c
@@ -257,13 +257,13 @@ static void tcp_fastopen_ccache_entry_drop(struct tcp_fastopen_ccache_entry *,
SYSCTL_NODE(_net_inet_tcp, OID_AUTO, fastopen, CTLFLAG_RW, 0, "TCP Fast Open");
-static VNET_DEFINE(int, tcp_fastopen_acceptany) = 0;
+VNET_DEFINE_STATIC(int, tcp_fastopen_acceptany) = 0;
#define V_tcp_fastopen_acceptany VNET(tcp_fastopen_acceptany)
SYSCTL_INT(_net_inet_tcp_fastopen, OID_AUTO, acceptany,
CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_fastopen_acceptany), 0,
"Accept any non-empty cookie");
-static VNET_DEFINE(unsigned int, tcp_fastopen_autokey) = 120;
+VNET_DEFINE_STATIC(unsigned int, tcp_fastopen_autokey) = 120;
#define V_tcp_fastopen_autokey VNET(tcp_fastopen_autokey)
static int sysctl_net_inet_tcp_fastopen_autokey(SYSCTL_HANDLER_ARGS);
SYSCTL_PROC(_net_inet_tcp_fastopen, OID_AUTO, autokey,
@@ -277,7 +277,7 @@ SYSCTL_PROC(_net_inet_tcp_fastopen, OID_AUTO, ccache_bucket_limit,
&sysctl_net_inet_tcp_fastopen_ccache_bucket_limit, "IU",
"Max entries per bucket in client cookie cache");
-static VNET_DEFINE(unsigned int, tcp_fastopen_ccache_buckets) =
+VNET_DEFINE_STATIC(unsigned int, tcp_fastopen_ccache_buckets) =
TCP_FASTOPEN_CCACHE_BUCKETS_DEFAULT;
#define V_tcp_fastopen_ccache_buckets VNET(tcp_fastopen_ccache_buckets)
SYSCTL_UINT(_net_inet_tcp_fastopen, OID_AUTO, ccache_buckets,
@@ -303,26 +303,26 @@ SYSCTL_INT(_net_inet_tcp_fastopen, OID_AUTO, maxpsks,
CTLFLAG_RD, SYSCTL_NULL_INT_PTR, TCP_FASTOPEN_MAX_PSKS,
"Maximum number of pre-shared keys supported");
-static VNET_DEFINE(unsigned int, tcp_fastopen_numkeys) = 0;
+VNET_DEFINE_STATIC(unsigned int, tcp_fastopen_numkeys) = 0;
#define V_tcp_fastopen_numkeys VNET(tcp_fastopen_numkeys)
SYSCTL_UINT(_net_inet_tcp_fastopen, OID_AUTO, numkeys,
CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(tcp_fastopen_numkeys), 0,
"Number of keys installed");
-static VNET_DEFINE(unsigned int, tcp_fastopen_numpsks) = 0;
+VNET_DEFINE_STATIC(unsigned int, tcp_fastopen_numpsks) = 0;
#define V_tcp_fastopen_numpsks VNET(tcp_fastopen_numpsks)
SYSCTL_UINT(_net_inet_tcp_fastopen, OID_AUTO, numpsks,
CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(tcp_fastopen_numpsks), 0,
"Number of pre-shared keys installed");
-static VNET_DEFINE(unsigned int, tcp_fastopen_path_disable_time) =
+VNET_DEFINE_STATIC(unsigned int, tcp_fastopen_path_disable_time) =
TCP_FASTOPEN_PATH_DISABLE_TIME_DEFAULT;
#define V_tcp_fastopen_path_disable_time VNET(tcp_fastopen_path_disable_time)
SYSCTL_UINT(_net_inet_tcp_fastopen, OID_AUTO, path_disable_time,
CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_fastopen_path_disable_time), 0,
"Seconds a TFO failure disables a {client_ip, server_ip, server_port} path");
-static VNET_DEFINE(unsigned int, tcp_fastopen_psk_enable) = 0;
+VNET_DEFINE_STATIC(unsigned int, tcp_fastopen_psk_enable) = 0;
#define V_tcp_fastopen_psk_enable VNET(tcp_fastopen_psk_enable)
static int sysctl_net_inet_tcp_fastopen_psk_enable(SYSCTL_HANDLER_ARGS);
SYSCTL_PROC(_net_inet_tcp_fastopen, OID_AUTO, psk_enable,
@@ -355,7 +355,7 @@ SYSCTL_PROC(_net_inet_tcp_fastopen, OID_AUTO, ccache_list,
sysctl_net_inet_tcp_fastopen_ccache_list, "A",
"List of all client cookie cache entries");
-static VNET_DEFINE(struct rmlock, tcp_fastopen_keylock);
+VNET_DEFINE_STATIC(struct rmlock, tcp_fastopen_keylock);
#define V_tcp_fastopen_keylock VNET(tcp_fastopen_keylock)
#define TCP_FASTOPEN_KEYS_RLOCK(t) rm_rlock(&V_tcp_fastopen_keylock, (t))
@@ -363,18 +363,18 @@ static VNET_DEFINE(struct rmlock, tcp_fastopen_keylock);
#define TCP_FASTOPEN_KEYS_WLOCK() rm_wlock(&V_tcp_fastopen_keylock)
#define TCP_FASTOPEN_KEYS_WUNLOCK() rm_wunlock(&V_tcp_fastopen_keylock)
-static VNET_DEFINE(struct tcp_fastopen_keylist, tcp_fastopen_keys);
+VNET_DEFINE_STATIC(struct tcp_fastopen_keylist, tcp_fastopen_keys);
#define V_tcp_fastopen_keys VNET(tcp_fastopen_keys)
-static VNET_DEFINE(struct tcp_fastopen_callout, tcp_fastopen_autokey_ctx);
+VNET_DEFINE_STATIC(struct tcp_fastopen_callout, tcp_fastopen_autokey_ctx);
#define V_tcp_fastopen_autokey_ctx VNET(tcp_fastopen_autokey_ctx)
-static VNET_DEFINE(uma_zone_t, counter_zone);
+VNET_DEFINE_STATIC(uma_zone_t, counter_zone);
#define V_counter_zone VNET(counter_zone)
static MALLOC_DEFINE(M_TCP_FASTOPEN_CCACHE, "tfo_ccache", "TFO client cookie cache buckets");
-static VNET_DEFINE(struct tcp_fastopen_ccache, tcp_fastopen_ccache);
+VNET_DEFINE_STATIC(struct tcp_fastopen_ccache, tcp_fastopen_ccache);
#define V_tcp_fastopen_ccache VNET(tcp_fastopen_ccache)
#define CCB_LOCK(ccb) mtx_lock(&(ccb)->ccb_mtx)
diff --git a/sys/netinet/tcp_hostcache.c b/sys/netinet/tcp_hostcache.c
index 263f8346a1a8..1b4dc0d24655 100644
--- a/sys/netinet/tcp_hostcache.c
+++ b/sys/netinet/tcp_hostcache.c
@@ -112,10 +112,10 @@ __FBSDID("$FreeBSD$");
#define TCP_HOSTCACHE_EXPIRE 60*60 /* one hour */
#define TCP_HOSTCACHE_PRUNE 5*60 /* every 5 minutes */
-static VNET_DEFINE(struct tcp_hostcache, tcp_hostcache);
+VNET_DEFINE_STATIC(struct tcp_hostcache, tcp_hostcache);
#define V_tcp_hostcache VNET(tcp_hostcache)
-static VNET_DEFINE(struct callout, tcp_hc_callout);
+VNET_DEFINE_STATIC(struct callout, tcp_hc_callout);
#define V_tcp_hc_callout VNET(tcp_hc_callout)
static struct hc_metrics *tcp_hc_lookup(struct in_conninfo *);
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 812f03eecfe4..5a1731321217 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -210,13 +210,13 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, do_tcpdrain, CTLFLAG_RW, &do_tcpdrain, 0,
SYSCTL_UINT(_net_inet_tcp, OID_AUTO, pcbcount, CTLFLAG_VNET | CTLFLAG_RD,
&VNET_NAME(tcbinfo.ipi_count), 0, "Number of active PCBs");
-static VNET_DEFINE(int, icmp_may_rst) = 1;
+VNET_DEFINE_STATIC(int, icmp_may_rst) = 1;
#define V_icmp_may_rst VNET(icmp_may_rst)
SYSCTL_INT(_net_inet_tcp, OID_AUTO, icmp_may_rst, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(icmp_may_rst), 0,
"Certain ICMP unreachable messages may abort connections in SYN_SENT");
-static VNET_DEFINE(int, tcp_isn_reseed_interval) = 0;
+VNET_DEFINE_STATIC(int, tcp_isn_reseed_interval) = 0;
#define V_tcp_isn_reseed_interval VNET(tcp_isn_reseed_interval)
SYSCTL_INT(_net_inet_tcp, OID_AUTO, isn_reseed_interval, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(tcp_isn_reseed_interval), 0,
@@ -695,7 +695,7 @@ struct tcpcb_mem {
#endif
};
-static VNET_DEFINE(uma_zone_t, tcpcb_zone);
+VNET_DEFINE_STATIC(uma_zone_t, tcpcb_zone);
#define V_tcpcb_zone VNET(tcpcb_zone)
MALLOC_DEFINE(M_TCPLOG, "tcplog", "TCP address and flags print buffers");
@@ -2652,11 +2652,11 @@ out:
#define ISN_STATIC_INCREMENT 4096
#define ISN_RANDOM_INCREMENT (4096 - 1)
-static VNET_DEFINE(u_char, isn_secret[32]);
-static VNET_DEFINE(int, isn_last);
-static VNET_DEFINE(int, isn_last_reseed);
-static VNET_DEFINE(u_int32_t, isn_offset);
-static VNET_DEFINE(u_int32_t, isn_offset_old);
+VNET_DEFINE_STATIC(u_char, isn_secret[32]);
+VNET_DEFINE_STATIC(int, isn_last);
+VNET_DEFINE_STATIC(int, isn_last_reseed);
+VNET_DEFINE_STATIC(u_int32_t, isn_offset);
+VNET_DEFINE_STATIC(u_int32_t, isn_offset_old);
#define V_isn_secret VNET(isn_secret)
#define V_isn_last VNET(isn_last)
diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c
index f31bc0f215ff..93026d1e1533 100644
--- a/sys/netinet/tcp_syncache.c
+++ b/sys/netinet/tcp_syncache.c
@@ -102,19 +102,19 @@ __FBSDID("$FreeBSD$");
#include <security/mac/mac_framework.h>
-static VNET_DEFINE(int, tcp_syncookies) = 1;
+VNET_DEFINE_STATIC(int, tcp_syncookies) = 1;
#define V_tcp_syncookies VNET(tcp_syncookies)
SYSCTL_INT(_net_inet_tcp, OID_AUTO, syncookies, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(tcp_syncookies), 0,
"Use TCP SYN cookies if the syncache overflows");
-static VNET_DEFINE(int, tcp_syncookiesonly) = 0;
+VNET_DEFINE_STATIC(int, tcp_syncookiesonly) = 0;
#define V_tcp_syncookiesonly VNET(tcp_syncookiesonly)
SYSCTL_INT(_net_inet_tcp, OID_AUTO, syncookies_only, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(tcp_syncookiesonly), 0,
"Use only TCP SYN cookies");
-static VNET_DEFINE(int, functions_inherit_listen_socket_stack) = 1;
+VNET_DEFINE_STATIC(int, functions_inherit_listen_socket_stack) = 1;
#define V_functions_inherit_listen_socket_stack \
VNET(functions_inherit_listen_socket_stack)
SYSCTL_INT(_net_inet_tcp, OID_AUTO, functions_inherit_listen_socket_stack,
@@ -162,7 +162,7 @@ static int syncookie_cmp(struct in_conninfo *inc, struct syncache_head *sch,
#define TCP_SYNCACHE_HASHSIZE 512
#define TCP_SYNCACHE_BUCKETLIMIT 30
-static VNET_DEFINE(struct tcp_syncache, tcp_syncache);
+VNET_DEFINE_STATIC(struct tcp_syncache, tcp_syncache);
#define V_tcp_syncache VNET(tcp_syncache)
static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, syncache, CTLFLAG_RW, 0,
diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c
index 3ce0ceb3ad68..e6c60c95f549 100644
--- a/sys/netinet/tcp_timewait.c
+++ b/sys/netinet/tcp_timewait.c
@@ -96,7 +96,7 @@ __FBSDID("$FreeBSD$");
#include <security/mac/mac_framework.h>
-static VNET_DEFINE(uma_zone_t, tcptw_zone);
+VNET_DEFINE_STATIC(uma_zone_t, tcptw_zone);
#define V_tcptw_zone VNET(tcptw_zone)
static int maxtcptw;
@@ -111,11 +111,11 @@ static int maxtcptw;
* - a tcptw relies on its inpcb reference counting for memory stability
* - a tcptw is dereferenceable only while its inpcb is locked
*/
-static VNET_DEFINE(TAILQ_HEAD(, tcptw), twq_2msl);
+VNET_DEFINE_STATIC(TAILQ_HEAD(, tcptw), twq_2msl);
#define V_twq_2msl VNET(twq_2msl)
/* Global timewait lock */
-static VNET_DEFINE(struct rwlock, tw_lock);
+VNET_DEFINE_STATIC(struct rwlock, tw_lock);
#define V_tw_lock VNET(tw_lock)
#define TW_LOCK_INIT(tw, d) rw_init_flags(&(tw), (d), 0)
@@ -172,7 +172,7 @@ SYSCTL_PROC(_net_inet_tcp, OID_AUTO, maxtcptw, CTLTYPE_INT|CTLFLAG_RW,
&maxtcptw, 0, sysctl_maxtcptw, "IU",
"Maximum number of compressed TCP TIME_WAIT entries");
-static VNET_DEFINE(int, nolocaltimewait) = 0;
+VNET_DEFINE_STATIC(int, nolocaltimewait) = 0;
#define V_nolocaltimewait VNET(nolocaltimewait)
SYSCTL_INT(_net_inet_tcp, OID_AUTO, nolocaltimewait, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(nolocaltimewait), 0,
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 24cb50098131..091fed1700a4 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -144,7 +144,7 @@ VNET_DEFINE(struct inpcbhead, udb); /* from udp_var.h */
VNET_DEFINE(struct inpcbinfo, udbinfo);
VNET_DEFINE(struct inpcbhead, ulitecb);
VNET_DEFINE(struct inpcbinfo, ulitecbinfo);
-static VNET_DEFINE(uma_zone_t, udpcb_zone);
+VNET_DEFINE_STATIC(uma_zone_t, udpcb_zone);
#define V_udpcb_zone VNET(udpcb_zone)
#ifndef UDBHASHSIZE
diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c
index 0d243f923a96..630b71c1934b 100644
--- a/sys/netinet6/frag6.c
+++ b/sys/netinet6/frag6.c
@@ -75,9 +75,9 @@ static struct mtx ip6qlock;
/*
* These fields all protected by ip6qlock.
*/
-static VNET_DEFINE(u_int, frag6_nfragpackets);
-static VNET_DEFINE(u_int, frag6_nfrags);
-static VNET_DEFINE(struct ip6q, ip6q); /* ip6 reassemble queue */
+VNET_DEFINE_STATIC(u_int, frag6_nfragpackets);
+VNET_DEFINE_STATIC(u_int, frag6_nfrags);
+VNET_DEFINE_STATIC(struct ip6q, ip6q); /* ip6 reassemble queue */
#define V_frag6_nfragpackets VNET(frag6_nfragpackets)
#define V_frag6_nfrags VNET(frag6_nfrags)
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index 4b6111c143dc..0bb5636602ff 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -124,8 +124,8 @@ VNET_PCPUSTAT_SYSUNINIT(icmp6stat);
VNET_DECLARE(struct inpcbinfo, ripcbinfo);
VNET_DECLARE(struct inpcbhead, ripcb);
VNET_DECLARE(int, icmp6errppslim);
-static VNET_DEFINE(int, icmp6errpps_count) = 0;
-static VNET_DEFINE(struct timeval, icmp6errppslim_last);
+VNET_DEFINE_STATIC(int, icmp6errpps_count) = 0;
+VNET_DEFINE_STATIC(struct timeval, icmp6errppslim_last);
VNET_DECLARE(int, icmp6_nodeinfo);
#define V_ripcbinfo VNET(ripcbinfo)
diff --git a/sys/netinet6/in6_gif.c b/sys/netinet6/in6_gif.c
index 0293237ffcb7..b7c964c2cf3d 100644
--- a/sys/netinet6/in6_gif.c
+++ b/sys/netinet6/in6_gif.c
@@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$");
#include <net/if_gif.h>
#define GIF_HLIM 30
-static VNET_DEFINE(int, ip6_gif_hlim) = GIF_HLIM;
+VNET_DEFINE_STATIC(int, ip6_gif_hlim) = GIF_HLIM;
#define V_ip6_gif_hlim VNET(ip6_gif_hlim)
SYSCTL_DECL(_net_inet6_ip6);
@@ -86,8 +86,8 @@ SYSCTL_INT(_net_inet6_ip6, IPV6CTL_GIF_HLIM, gifhlim,
* We keep interfaces in a hash table using src+dst as key.
* Interfaces with GIF_IGNORE_SOURCE flag are linked into plain list.
*/
-static VNET_DEFINE(struct gif_list *, ipv6_hashtbl) = NULL;
-static VNET_DEFINE(struct gif_list, ipv6_list) = CK_LIST_HEAD_INITIALIZER();
+VNET_DEFINE_STATIC(struct gif_list *, ipv6_hashtbl) = NULL;
+VNET_DEFINE_STATIC(struct gif_list, ipv6_list) = CK_LIST_HEAD_INITIALIZER();
#define V_ipv6_hashtbl VNET(ipv6_hashtbl)
#define V_ipv6_list VNET(ipv6_list)
diff --git a/sys/netinet6/in6_rmx.c b/sys/netinet6/in6_rmx.c
index 728e53ef4645..0201ab982081 100644
--- a/sys/netinet6/in6_rmx.c
+++ b/sys/netinet6/in6_rmx.c
@@ -159,7 +159,7 @@ struct mtuex_arg {
struct rib_head *rnh;
time_t nextstop;
};
-static VNET_DEFINE(struct callout, rtq_mtutimer);
+VNET_DEFINE_STATIC(struct callout, rtq_mtutimer);
#define V_rtq_mtutimer VNET(rtq_mtutimer)
static int
@@ -209,7 +209,7 @@ in6_mtutimo(void *rock)
/*
* Initialize our routing tree.
*/
-static VNET_DEFINE(int, _in6_rt_was_here);
+VNET_DEFINE_STATIC(int, _in6_rt_was_here);
#define V__in6_rt_was_here VNET(_in6_rt_was_here)
int
diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c
index a293afabfd45..e14f0d46176b 100644
--- a/sys/netinet6/in6_src.c
+++ b/sys/netinet6/in6_src.c
@@ -127,7 +127,7 @@ static struct sx addrsel_sxlock;
#define ADDRSEL_XUNLOCK() sx_xunlock(&addrsel_sxlock)
#define ADDR_LABEL_NOTAPP (-1)
-static VNET_DEFINE(struct in6_addrpolicy, defaultaddrpolicy);
+VNET_DEFINE_STATIC(struct in6_addrpolicy, defaultaddrpolicy);
#define V_defaultaddrpolicy VNET(defaultaddrpolicy)
VNET_DEFINE(int, ip6_prefer_tempaddr) = 0;
@@ -1094,7 +1094,7 @@ struct addrsel_policyent {
TAILQ_HEAD(addrsel_policyhead, addrsel_policyent);
-static VNET_DEFINE(struct addrsel_policyhead, addrsel_policytab);
+VNET_DEFINE_STATIC(struct addrsel_policyhead, addrsel_policytab);
#define V_addrsel_policytab VNET(addrsel_policytab)
static void
diff --git a/sys/netinet6/ip6_gre.c b/sys/netinet6/ip6_gre.c
index 48aa8cb03ac2..8c60eb5918c4 100644
--- a/sys/netinet6/ip6_gre.c
+++ b/sys/netinet6/ip6_gre.c
@@ -65,7 +65,7 @@ SYSCTL_DECL(_net_inet6_ip6);
SYSCTL_INT(_net_inet6_ip6, OID_AUTO, grehlim, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(ip6_gre_hlim), 0, "Default hop limit for encapsulated packets");
-static VNET_DEFINE(struct gre_list *, ipv6_hashtbl) = NULL;
+VNET_DEFINE_STATIC(struct gre_list *, ipv6_hashtbl) = NULL;
#define V_ipv6_hashtbl VNET(ipv6_hashtbl)
#define GRE_HASH(src, dst) (V_ipv6_hashtbl[\
in6_gre_hashval((src), (dst)) & (GRE_HASH_SIZE - 1)])
diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c
index b4a7a3adda5b..9bbcc9ee85fa 100644
--- a/sys/netinet6/ip6_mroute.c
+++ b/sys/netinet6/ip6_mroute.c
@@ -150,7 +150,7 @@ static const struct encap_config ipv6_encap_cfg = {
};
-static VNET_DEFINE(int, ip6_mrouter_ver) = 0;
+VNET_DEFINE_STATIC(int, ip6_mrouter_ver) = 0;
#define V_ip6_mrouter_ver VNET(ip6_mrouter_ver)
SYSCTL_DECL(_net_inet6);
@@ -235,7 +235,7 @@ static struct mtx mif6_mtx;
#define MIF6_LOCK_DESTROY() mtx_destroy(&mif6_mtx)
#ifdef MRT6DEBUG
-static VNET_DEFINE(u_int, mrt6debug) = 0; /* debug level */
+VNET_DEFINE_STATIC(u_int, mrt6debug) = 0; /* debug level */
#define V_mrt6debug VNET(mrt6debug)
#define DEBUG_MFC 0x02
#define DEBUG_FORWARD 0x04
@@ -288,7 +288,7 @@ SYSCTL_STRUCT(_net_inet6_pim, PIM6CTL_STATS, stats, CTLFLAG_RW,
"PIM Statistics (struct pim6stat, netinet6/pim6_var.h)");
#define PIM6STAT_INC(name) pim6stat.name += 1
-static VNET_DEFINE(int, pim6);
+VNET_DEFINE_STATIC(int, pim6);
#define V_pim6 VNET(pim6)
/*
diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c
index 015ec39806dc..3d7f59569ce2 100644
--- a/sys/netinet6/mld6.c
+++ b/sys/netinet6/mld6.c
@@ -207,11 +207,11 @@ static MALLOC_DEFINE(M_MLD, "mld", "mld state");
/*
* VIMAGE-wide globals.
*/
-static VNET_DEFINE(struct timeval, mld_gsrdelay) = {10, 0};
-static VNET_DEFINE(LIST_HEAD(, mld_ifsoftc), mli_head);
-static VNET_DEFINE(int, interface_timers_running6);
-static VNET_DEFINE(int, state_change_timers_running6);
-static VNET_DEFINE(int, current_state_timers_running6);
+VNET_DEFINE_STATIC(struct timeval, mld_gsrdelay) = {10, 0};
+VNET_DEFINE_STATIC(LIST_HEAD(, mld_ifsoftc), mli_head);
+VNET_DEFINE_STATIC(int, interface_timers_running6);
+VNET_DEFINE_STATIC(int, state_change_timers_running6);
+VNET_DEFINE_STATIC(int, current_state_timers_running6);
#define V_mld_gsrdelay VNET(mld_gsrdelay)
#define V_mli_head VNET(mli_head)
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index f713759b76cc..388e48879b17 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -98,11 +98,11 @@ VNET_DEFINE(int, nd6_gctimer) = (60 * 60 * 24); /* 1 day: garbage
* collection timer */
/* preventing too many loops in ND option parsing */
-static VNET_DEFINE(int, nd6_maxndopt) = 10; /* max # of ND options allowed */
+VNET_DEFINE_STATIC(int, nd6_maxndopt) = 10; /* max # of ND options allowed */
VNET_DEFINE(int, nd6_maxnudhint) = 0; /* max # of subsequent upper
* layer hints */
-static VNET_DEFINE(int, nd6_maxqueuelen) = 1; /* max pkts cached in unresolved
+VNET_DEFINE_STATIC(int, nd6_maxqueuelen) = 1; /* max pkts cached in unresolved
* ND entries */
#define V_nd6_maxndopt VNET(nd6_maxndopt)
#define V_nd6_maxqueuelen VNET(nd6_maxqueuelen)
@@ -142,7 +142,7 @@ static int nd6_resolve_slow(struct ifnet *, int, struct mbuf *,
static int nd6_need_cache(struct ifnet *);
-static VNET_DEFINE(struct callout, nd6_slowtimo_ch);
+VNET_DEFINE_STATIC(struct callout, nd6_slowtimo_ch);
#define V_nd6_slowtimo_ch VNET(nd6_slowtimo_ch)
VNET_DEFINE(struct callout, nd6_timer_ch);
diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c
index 39a8ab0701bd..a3d7579b7c42 100644
--- a/sys/netinet6/nd6_nbr.c
+++ b/sys/netinet6/nd6_nbr.c
@@ -99,7 +99,7 @@ static void nd6_na_output_fib(struct ifnet *, const struct in6_addr *,
static void nd6_ns_output_fib(struct ifnet *, const struct in6_addr *,
const struct in6_addr *, const struct in6_addr *, uint8_t *, u_int);
-static VNET_DEFINE(int, dad_enhanced) = 1;
+VNET_DEFINE_STATIC(int, dad_enhanced) = 1;
#define V_dad_enhanced VNET(dad_enhanced)
SYSCTL_DECL(_net_inet6_ip6);
@@ -107,7 +107,7 @@ SYSCTL_INT(_net_inet6_ip6, OID_AUTO, dad_enhanced, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(dad_enhanced), 0,
"Enable Enhanced DAD, which adds a random nonce to NS messages for DAD.");
-static VNET_DEFINE(int, dad_maxtry) = 15; /* max # of *tries* to
+VNET_DEFINE_STATIC(int, dad_maxtry) = 15; /* max # of *tries* to
transmit DAD packet */
#define V_dad_maxtry VNET(dad_maxtry)
@@ -1120,8 +1120,8 @@ struct dadq {
bool dad_ondadq; /* on dadq? Protected by DADQ_WLOCK. */
};
-static VNET_DEFINE(TAILQ_HEAD(, dadq), dadq);
-static VNET_DEFINE(struct rwlock, dad_rwlock);
+VNET_DEFINE_STATIC(TAILQ_HEAD(, dadq), dadq);
+VNET_DEFINE_STATIC(struct rwlock, dad_rwlock);
#define V_dadq VNET(dadq)
#define V_dad_rwlock VNET(dad_rwlock)
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c
index 4fa81cb750b3..ec1aa13730ca 100644
--- a/sys/netinet6/nd6_rtr.c
+++ b/sys/netinet6/nd6_rtr.c
@@ -94,7 +94,7 @@ static int rt6_deleteroute(const struct rtentry *, void *);
VNET_DECLARE(int, nd6_recalc_reachtm_interval);
#define V_nd6_recalc_reachtm_interval VNET(nd6_recalc_reachtm_interval)
-static VNET_DEFINE(struct ifnet *, nd6_defifp);
+VNET_DEFINE_STATIC(struct ifnet *, nd6_defifp);
VNET_DEFINE(int, nd6_defifindex);
#define V_nd6_defifp VNET(nd6_defifp)
diff --git a/sys/netinet6/scope6.c b/sys/netinet6/scope6.c
index 3f65e3765efb..092910da26fb 100644
--- a/sys/netinet6/scope6.c
+++ b/sys/netinet6/scope6.c
@@ -76,7 +76,7 @@ static struct mtx scope6_lock;
#define SCOPE6_UNLOCK() mtx_unlock(&scope6_lock)
#define SCOPE6_LOCK_ASSERT() mtx_assert(&scope6_lock, MA_OWNED)
-static VNET_DEFINE(struct scope6_id, sid_default);
+VNET_DEFINE_STATIC(struct scope6_id, sid_default);
#define V_sid_default VNET(sid_default)
#define SID(ifp) \
diff --git a/sys/netinet6/send.c b/sys/netinet6/send.c
index e63098f75ff6..bc9880c82267 100644
--- a/sys/netinet6/send.c
+++ b/sys/netinet6/send.c
@@ -64,7 +64,7 @@ static MALLOC_DEFINE(M_SEND, "send", "Secure Neighbour Discovery");
/*
* The socket used to communicate with the SeND daemon.
*/
-static VNET_DEFINE(struct socket *, send_so);
+VNET_DEFINE_STATIC(struct socket *, send_so);
#define V_send_so VNET(send_so)
u_long send_sendspace = 8 * (1024 + sizeof(struct sockaddr_send));
diff --git a/sys/netipsec/ipsec.c b/sys/netipsec/ipsec.c
index 6267a23c6648..8d3e16723925 100644
--- a/sys/netipsec/ipsec.c
+++ b/sys/netipsec/ipsec.c
@@ -119,11 +119,11 @@ VNET_DEFINE(int, ip4_ah_net_deflev) = IPSEC_LEVEL_USE;
/* ECN ignore(-1)/forbidden(0)/allowed(1) */
VNET_DEFINE(int, ip4_ipsec_ecn) = 0;
-static VNET_DEFINE(int, ip4_filtertunnel) = 0;
+VNET_DEFINE_STATIC(int, ip4_filtertunnel) = 0;
#define V_ip4_filtertunnel VNET(ip4_filtertunnel)
-static VNET_DEFINE(int, check_policy_history) = 0;
+VNET_DEFINE_STATIC(int, check_policy_history) = 0;
#define V_check_policy_history VNET(check_policy_history)
-static VNET_DEFINE(struct secpolicy *, def_policy) = NULL;
+VNET_DEFINE_STATIC(struct secpolicy *, def_policy) = NULL;
#define V_def_policy VNET(def_policy)
static int
sysctl_def_policy(SYSCTL_HANDLER_ARGS)
@@ -249,7 +249,7 @@ VNET_DEFINE(int, ip6_ah_trans_deflev) = IPSEC_LEVEL_USE;
VNET_DEFINE(int, ip6_ah_net_deflev) = IPSEC_LEVEL_USE;
VNET_DEFINE(int, ip6_ipsec_ecn) = 0; /* ECN ignore(-1)/forbidden(0)/allowed(1) */
-static VNET_DEFINE(int, ip6_filtertunnel) = 0;
+VNET_DEFINE_STATIC(int, ip6_filtertunnel) = 0;
#define V_ip6_filtertunnel VNET(ip6_filtertunnel)
SYSCTL_DECL(_net_inet6_ipsec6);
diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c
index 0b90d46d4d0b..8f5004a0613c 100644
--- a/sys/netipsec/key.c
+++ b/sys/netipsec/key.c
@@ -113,20 +113,20 @@
*/
VNET_DEFINE(u_int32_t, key_debug_level) = 0;
-static VNET_DEFINE(u_int, key_spi_trycnt) = 1000;
-static VNET_DEFINE(u_int32_t, key_spi_minval) = 0x100;
-static VNET_DEFINE(u_int32_t, key_spi_maxval) = 0x0fffffff; /* XXX */
-static VNET_DEFINE(u_int32_t, policy_id) = 0;
+VNET_DEFINE_STATIC(u_int, key_spi_trycnt) = 1000;
+VNET_DEFINE_STATIC(u_int32_t, key_spi_minval) = 0x100;
+VNET_DEFINE_STATIC(u_int32_t, key_spi_maxval) = 0x0fffffff; /* XXX */
+VNET_DEFINE_STATIC(u_int32_t, policy_id) = 0;
/*interval to initialize randseed,1(m)*/
-static VNET_DEFINE(u_int, key_int_random) = 60;
+VNET_DEFINE_STATIC(u_int, key_int_random) = 60;
/* interval to expire acquiring, 30(s)*/
-static VNET_DEFINE(u_int, key_larval_lifetime) = 30;
+VNET_DEFINE_STATIC(u_int, key_larval_lifetime) = 30;
/* counter for blocking SADB_ACQUIRE.*/
-static VNET_DEFINE(int, key_blockacq_count) = 10;
+VNET_DEFINE_STATIC(int, key_blockacq_count) = 10;
/* lifetime for blocking SADB_ACQUIRE.*/
-static VNET_DEFINE(int, key_blockacq_lifetime) = 20;
+VNET_DEFINE_STATIC(int, key_blockacq_lifetime) = 20;
/* preferred old sa rather than new sa.*/
-static VNET_DEFINE(int, key_preferred_oldsa) = 1;
+VNET_DEFINE_STATIC(int, key_preferred_oldsa) = 1;
#define V_key_spi_trycnt VNET(key_spi_trycnt)
#define V_key_spi_minval VNET(key_spi_minval)
#define V_key_spi_maxval VNET(key_spi_maxval)
@@ -137,17 +137,17 @@ static VNET_DEFINE(int, key_preferred_oldsa) = 1;
#define V_key_blockacq_lifetime VNET(key_blockacq_lifetime)
#define V_key_preferred_oldsa VNET(key_preferred_oldsa)
-static VNET_DEFINE(u_int32_t, acq_seq) = 0;
+VNET_DEFINE_STATIC(u_int32_t, acq_seq) = 0;
#define V_acq_seq VNET(acq_seq)
-static VNET_DEFINE(uint32_t, sp_genid) = 0;
+VNET_DEFINE_STATIC(uint32_t, sp_genid) = 0;
#define V_sp_genid VNET(sp_genid)
/* SPD */
TAILQ_HEAD(secpolicy_queue, secpolicy);
LIST_HEAD(secpolicy_list, secpolicy);
-static VNET_DEFINE(struct secpolicy_queue, sptree[IPSEC_DIR_MAX]);
-static VNET_DEFINE(struct secpolicy_queue, sptree_ifnet[IPSEC_DIR_MAX]);
+VNET_DEFINE_STATIC(struct secpolicy_queue, sptree[IPSEC_DIR_MAX]);
+VNET_DEFINE_STATIC(struct secpolicy_queue, sptree_ifnet[IPSEC_DIR_MAX]);
static struct rmlock sptree_lock;
#define V_sptree VNET(sptree)
#define V_sptree_ifnet VNET(sptree_ifnet)
@@ -163,8 +163,8 @@ static struct rmlock sptree_lock;
#define SPTREE_UNLOCK_ASSERT() rm_assert(&sptree_lock, RA_UNLOCKED)
/* Hash table for lookup SP using unique id */
-static VNET_DEFINE(struct secpolicy_list *, sphashtbl);
-static VNET_DEFINE(u_long, sphash_mask);
+VNET_DEFINE_STATIC(struct secpolicy_list *, sphashtbl);
+VNET_DEFINE_STATIC(u_long, sphash_mask);
#define V_sphashtbl VNET(sphashtbl)
#define V_sphash_mask VNET(sphash_mask)
@@ -184,19 +184,19 @@ LIST_HEAD(spdcache_entry_list, spdcache_entry);
#define SPDCACHE_MAX_ENTRIES_PER_HASH 8
-static VNET_DEFINE(u_int, key_spdcache_maxentries) = 0;
+VNET_DEFINE_STATIC(u_int, key_spdcache_maxentries) = 0;
#define V_key_spdcache_maxentries VNET(key_spdcache_maxentries)
-static VNET_DEFINE(u_int, key_spdcache_threshold) = 32;
+VNET_DEFINE_STATIC(u_int, key_spdcache_threshold) = 32;
#define V_key_spdcache_threshold VNET(key_spdcache_threshold)
-static VNET_DEFINE(unsigned long, spd_size) = 0;
+VNET_DEFINE_STATIC(unsigned long, spd_size) = 0;
#define V_spd_size VNET(spd_size)
#define SPDCACHE_ENABLED() (V_key_spdcache_maxentries != 0)
#define SPDCACHE_ACTIVE() \
(SPDCACHE_ENABLED() && V_spd_size >= V_key_spdcache_threshold)
-static VNET_DEFINE(struct spdcache_entry_list *, spdcachehashtbl);
-static VNET_DEFINE(u_long, spdcachehash_mask);
+VNET_DEFINE_STATIC(struct spdcache_entry_list *, spdcachehashtbl);
+VNET_DEFINE_STATIC(u_long, spdcachehash_mask);
#define V_spdcachehashtbl VNET(spdcachehashtbl)
#define V_spdcachehash_mask VNET(spdcachehash_mask)
@@ -205,7 +205,7 @@ static VNET_DEFINE(u_long, spdcachehash_mask);
V_spdcachehash_mask)
/* Each cache line is protected by a mutex */
-static VNET_DEFINE(struct mtx *, spdcache_lock);
+VNET_DEFINE_STATIC(struct mtx *, spdcache_lock);
#define V_spdcache_lock VNET(spdcache_lock)
#define SPDCACHE_LOCK_INIT(a) \
@@ -218,7 +218,7 @@ static VNET_DEFINE(struct mtx *, spdcache_lock);
/* SAD */
TAILQ_HEAD(secashead_queue, secashead);
LIST_HEAD(secashead_list, secashead);
-static VNET_DEFINE(struct secashead_queue, sahtree);
+VNET_DEFINE_STATIC(struct secashead_queue, sahtree);
static struct rmlock sahtree_lock;
#define V_sahtree VNET(sahtree)
#define SAHTREE_LOCK_INIT() rm_init(&sahtree_lock, "sahtree")
@@ -233,8 +233,8 @@ static struct rmlock sahtree_lock;
#define SAHTREE_UNLOCK_ASSERT() rm_assert(&sahtree_lock, RA_UNLOCKED)
/* Hash table for lookup in SAD using SA addresses */
-static VNET_DEFINE(struct secashead_list *, sahaddrhashtbl);
-static VNET_DEFINE(u_long, sahaddrhash_mask);
+VNET_DEFINE_STATIC(struct secashead_list *, sahaddrhashtbl);
+VNET_DEFINE_STATIC(u_long, sahaddrhash_mask);
#define V_sahaddrhashtbl VNET(sahaddrhashtbl)
#define V_sahaddrhash_mask VNET(sahaddrhash_mask)
@@ -248,8 +248,8 @@ static VNET_DEFINE(u_long, sahaddrhash_mask);
/* Hash table for lookup in SAD using SPI */
LIST_HEAD(secasvar_list, secasvar);
-static VNET_DEFINE(struct secasvar_list *, savhashtbl);
-static VNET_DEFINE(u_long, savhash_mask);
+VNET_DEFINE_STATIC(struct secasvar_list *, savhashtbl);
+VNET_DEFINE_STATIC(u_long, savhash_mask);
#define V_savhashtbl VNET(savhashtbl)
#define V_savhash_mask VNET(savhash_mask)
#define SAVHASH_NHASH_LOG2 7
@@ -298,7 +298,7 @@ key_u32hash(uint32_t val)
}
/* registed list */
-static VNET_DEFINE(LIST_HEAD(_regtree, secreg), regtree[SADB_SATYPE_MAX + 1]);
+VNET_DEFINE_STATIC(LIST_HEAD(_regtree, secreg), regtree[SADB_SATYPE_MAX + 1]);
#define V_regtree VNET(regtree)
static struct mtx regtree_lock;
#define REGTREE_LOCK_INIT() \
@@ -310,7 +310,7 @@ static struct mtx regtree_lock;
/* Acquiring list */
LIST_HEAD(secacq_list, secacq);
-static VNET_DEFINE(struct secacq_list, acqtree);
+VNET_DEFINE_STATIC(struct secacq_list, acqtree);
#define V_acqtree VNET(acqtree)
static struct mtx acq_lock;
#define ACQ_LOCK_INIT() \
@@ -321,14 +321,14 @@ static struct mtx acq_lock;
#define ACQ_LOCK_ASSERT() mtx_assert(&acq_lock, MA_OWNED)
/* Hash table for lookup in ACQ list using SA addresses */
-static VNET_DEFINE(struct secacq_list *, acqaddrhashtbl);
-static VNET_DEFINE(u_long, acqaddrhash_mask);
+VNET_DEFINE_STATIC(struct secacq_list *, acqaddrhashtbl);
+VNET_DEFINE_STATIC(u_long, acqaddrhash_mask);
#define V_acqaddrhashtbl VNET(acqaddrhashtbl)
#define V_acqaddrhash_mask VNET(acqaddrhash_mask)
/* Hash table for lookup in ACQ list using SEQ number */
-static VNET_DEFINE(struct secacq_list *, acqseqhashtbl);
-static VNET_DEFINE(u_long, acqseqhash_mask);
+VNET_DEFINE_STATIC(struct secacq_list *, acqseqhashtbl);
+VNET_DEFINE_STATIC(u_long, acqseqhash_mask);
#define V_acqseqhashtbl VNET(acqseqhashtbl)
#define V_acqseqhash_mask VNET(acqseqhash_mask)
@@ -344,7 +344,7 @@ static VNET_DEFINE(u_long, acqseqhash_mask);
#define ACQSEQHASH_HASH(seq) \
&V_acqseqhashtbl[ACQSEQHASH_HASHVAL(seq)]
/* SP acquiring list */
-static VNET_DEFINE(LIST_HEAD(_spacqtree, secspacq), spacqtree);
+VNET_DEFINE_STATIC(LIST_HEAD(_spacqtree, secspacq), spacqtree);
#define V_spacqtree VNET(spacqtree)
static struct mtx spacq_lock;
#define SPACQ_LOCK_INIT() \
@@ -433,9 +433,9 @@ _Static_assert(sizeof(maxsize)/sizeof(int) == SADB_EXT_MAX + 1, "minsize size mi
((_mhp)->extlen[(_ext)] > maxsize[(_ext)])))
#define SADB_CHECKHDR(_mhp, _ext) ((_mhp)->ext[(_ext)] == NULL)
-static VNET_DEFINE(int, ipsec_esp_keymin) = 256;
-static VNET_DEFINE(int, ipsec_esp_auth) = 0;
-static VNET_DEFINE(int, ipsec_ah_keymin) = 128;
+VNET_DEFINE_STATIC(int, ipsec_esp_keymin) = 256;
+VNET_DEFINE_STATIC(int, ipsec_esp_auth) = 0;
+VNET_DEFINE_STATIC(int, ipsec_ah_keymin) = 128;
#define V_ipsec_esp_keymin VNET(ipsec_esp_keymin)
#define V_ipsec_esp_auth VNET(ipsec_esp_auth)
@@ -531,7 +531,7 @@ MALLOC_DEFINE(M_IPSEC_SAQ, "ipsec-saq", "ipsec sa acquire");
MALLOC_DEFINE(M_IPSEC_SAR, "ipsec-reg", "ipsec sa acquire");
MALLOC_DEFINE(M_IPSEC_SPDCACHE, "ipsec-spdcache", "ipsec SPD cache");
-static VNET_DEFINE(uma_zone_t, key_lft_zone);
+VNET_DEFINE_STATIC(uma_zone_t, key_lft_zone);
#define V_key_lft_zone VNET(key_lft_zone)
static LIST_HEAD(xforms_list, xformsw) xforms = LIST_HEAD_INITIALIZER();
diff --git a/sys/netipsec/keysock.c b/sys/netipsec/keysock.c
index 7f8b0e51c59e..a216f085c1bc 100644
--- a/sys/netipsec/keysock.c
+++ b/sys/netipsec/keysock.c
@@ -71,7 +71,7 @@ struct key_cb {
int key_count;
int any_count;
};
-static VNET_DEFINE(struct key_cb, key_cb);
+VNET_DEFINE_STATIC(struct key_cb, key_cb);
#define V_key_cb VNET(key_cb)
static struct sockaddr key_src = { 2, PF_KEY, };
diff --git a/sys/netpfil/ipfw/ip_fw2.c b/sys/netpfil/ipfw/ip_fw2.c
index eb2b120e51ca..de0018ec2eb6 100644
--- a/sys/netpfil/ipfw/ip_fw2.c
+++ b/sys/netpfil/ipfw/ip_fw2.c
@@ -110,10 +110,10 @@ __FBSDID("$FreeBSD$");
* All ipfw global variables are here.
*/
-static VNET_DEFINE(int, fw_deny_unknown_exthdrs);
+VNET_DEFINE_STATIC(int, fw_deny_unknown_exthdrs);
#define V_fw_deny_unknown_exthdrs VNET(fw_deny_unknown_exthdrs)
-static VNET_DEFINE(int, fw_permit_single_frag6) = 1;
+VNET_DEFINE_STATIC(int, fw_permit_single_frag6) = 1;
#define V_fw_permit_single_frag6 VNET(fw_permit_single_frag6)
#ifdef IPFIREWALL_DEFAULT_TO_ACCEPT
diff --git a/sys/netpfil/ipfw/ip_fw_bpf.c b/sys/netpfil/ipfw/ip_fw_bpf.c
index 6f8aa39701c5..d7e10596573f 100644
--- a/sys/netpfil/ipfw/ip_fw_bpf.c
+++ b/sys/netpfil/ipfw/ip_fw_bpf.c
@@ -48,10 +48,10 @@ __FBSDID("$FreeBSD$");
#include <netinet/ip_var.h>
#include <netpfil/ipfw/ip_fw_private.h>
-static VNET_DEFINE(struct ifnet *, log_if);
-static VNET_DEFINE(struct ifnet *, pflog_if);
-static VNET_DEFINE(struct if_clone *, ipfw_cloner);
-static VNET_DEFINE(struct if_clone *, ipfwlog_cloner);
+VNET_DEFINE_STATIC(struct ifnet *, log_if);
+VNET_DEFINE_STATIC(struct ifnet *, pflog_if);
+VNET_DEFINE_STATIC(struct if_clone *, ipfw_cloner);
+VNET_DEFINE_STATIC(struct if_clone *, ipfwlog_cloner);
#define V_ipfw_cloner VNET(ipfw_cloner)
#define V_ipfwlog_cloner VNET(ipfwlog_cloner)
#define V_log_if VNET(log_if)
diff --git a/sys/netpfil/ipfw/ip_fw_dynamic.c b/sys/netpfil/ipfw/ip_fw_dynamic.c
index 6f877edf7944..761b768cd20e 100644
--- a/sys/netpfil/ipfw/ip_fw_dynamic.c
+++ b/sys/netpfil/ipfw/ip_fw_dynamic.c
@@ -179,11 +179,11 @@ struct dyn_ipv4_state {
SLIST_ENTRY(dyn_ipv4_state) expired;
};
CK_SLIST_HEAD(dyn_ipv4ck_slist, dyn_ipv4_state);
-static VNET_DEFINE(struct dyn_ipv4ck_slist *, dyn_ipv4);
-static VNET_DEFINE(struct dyn_ipv4ck_slist *, dyn_ipv4_parent);
+VNET_DEFINE_STATIC(struct dyn_ipv4ck_slist *, dyn_ipv4);
+VNET_DEFINE_STATIC(struct dyn_ipv4ck_slist *, dyn_ipv4_parent);
SLIST_HEAD(dyn_ipv4_slist, dyn_ipv4_state);
-static VNET_DEFINE(struct dyn_ipv4_slist, dyn_expired_ipv4);
+VNET_DEFINE_STATIC(struct dyn_ipv4_slist, dyn_expired_ipv4);
#define V_dyn_ipv4 VNET(dyn_ipv4)
#define V_dyn_ipv4_parent VNET(dyn_ipv4_parent)
#define V_dyn_expired_ipv4 VNET(dyn_expired_ipv4)
@@ -204,11 +204,11 @@ struct dyn_ipv6_state {
SLIST_ENTRY(dyn_ipv6_state) expired;
};
CK_SLIST_HEAD(dyn_ipv6ck_slist, dyn_ipv6_state);
-static VNET_DEFINE(struct dyn_ipv6ck_slist *, dyn_ipv6);
-static VNET_DEFINE(struct dyn_ipv6ck_slist *, dyn_ipv6_parent);
+VNET_DEFINE_STATIC(struct dyn_ipv6ck_slist *, dyn_ipv6);
+VNET_DEFINE_STATIC(struct dyn_ipv6ck_slist *, dyn_ipv6_parent);
SLIST_HEAD(dyn_ipv6_slist, dyn_ipv6_state);
-static VNET_DEFINE(struct dyn_ipv6_slist, dyn_expired_ipv6);
+VNET_DEFINE_STATIC(struct dyn_ipv6_slist, dyn_expired_ipv6);
#define V_dyn_ipv6 VNET(dyn_ipv6)
#define V_dyn_ipv6_parent VNET(dyn_ipv6_parent)
#define V_dyn_expired_ipv6 VNET(dyn_expired_ipv6)
@@ -255,28 +255,28 @@ DPCPU_DEFINE_STATIC(void *, dyn_hp);
* Currently one dyn_bucket_lock is used for all ipv4, ipv4_parent, ipv6,
* and ipv6_parent lists.
*/
-static VNET_DEFINE(struct mtx, dyn_expire_lock);
-static VNET_DEFINE(struct mtx *, dyn_bucket_lock);
+VNET_DEFINE_STATIC(struct mtx, dyn_expire_lock);
+VNET_DEFINE_STATIC(struct mtx *, dyn_bucket_lock);
#define V_dyn_expire_lock VNET(dyn_expire_lock)
#define V_dyn_bucket_lock VNET(dyn_bucket_lock)
/*
* Bucket's add/delete generation versions.
*/
-static VNET_DEFINE(uint32_t *, dyn_ipv4_add);
-static VNET_DEFINE(uint32_t *, dyn_ipv4_del);
-static VNET_DEFINE(uint32_t *, dyn_ipv4_parent_add);
-static VNET_DEFINE(uint32_t *, dyn_ipv4_parent_del);
+VNET_DEFINE_STATIC(uint32_t *, dyn_ipv4_add);
+VNET_DEFINE_STATIC(uint32_t *, dyn_ipv4_del);
+VNET_DEFINE_STATIC(uint32_t *, dyn_ipv4_parent_add);
+VNET_DEFINE_STATIC(uint32_t *, dyn_ipv4_parent_del);
#define V_dyn_ipv4_add VNET(dyn_ipv4_add)
#define V_dyn_ipv4_del VNET(dyn_ipv4_del)
#define V_dyn_ipv4_parent_add VNET(dyn_ipv4_parent_add)
#define V_dyn_ipv4_parent_del VNET(dyn_ipv4_parent_del)
#ifdef INET6
-static VNET_DEFINE(uint32_t *, dyn_ipv6_add);
-static VNET_DEFINE(uint32_t *, dyn_ipv6_del);
-static VNET_DEFINE(uint32_t *, dyn_ipv6_parent_add);
-static VNET_DEFINE(uint32_t *, dyn_ipv6_parent_del);
+VNET_DEFINE_STATIC(uint32_t *, dyn_ipv6_add);
+VNET_DEFINE_STATIC(uint32_t *, dyn_ipv6_del);
+VNET_DEFINE_STATIC(uint32_t *, dyn_ipv6_parent_add);
+VNET_DEFINE_STATIC(uint32_t *, dyn_ipv6_parent_del);
#define V_dyn_ipv6_add VNET(dyn_ipv6_add)
#define V_dyn_ipv6_del VNET(dyn_ipv6_del)
#define V_dyn_ipv6_parent_add VNET(dyn_ipv6_parent_add)
@@ -300,25 +300,25 @@ static VNET_DEFINE(uint32_t *, dyn_ipv6_parent_del);
#define DYN_EXPIRED_LOCK() mtx_lock(&V_dyn_expire_lock)
#define DYN_EXPIRED_UNLOCK() mtx_unlock(&V_dyn_expire_lock)
-static VNET_DEFINE(uint32_t, dyn_buckets_max);
-static VNET_DEFINE(uint32_t, curr_dyn_buckets);
-static VNET_DEFINE(struct callout, dyn_timeout);
+VNET_DEFINE_STATIC(uint32_t, dyn_buckets_max);
+VNET_DEFINE_STATIC(uint32_t, curr_dyn_buckets);
+VNET_DEFINE_STATIC(struct callout, dyn_timeout);
#define V_dyn_buckets_max VNET(dyn_buckets_max)
#define V_curr_dyn_buckets VNET(curr_dyn_buckets)
#define V_dyn_timeout VNET(dyn_timeout)
/* Maximum length of states chain in a bucket */
-static VNET_DEFINE(uint32_t, curr_max_length);
+VNET_DEFINE_STATIC(uint32_t, curr_max_length);
#define V_curr_max_length VNET(curr_max_length)
-static VNET_DEFINE(uint32_t, dyn_keep_states);
+VNET_DEFINE_STATIC(uint32_t, dyn_keep_states);
#define V_dyn_keep_states VNET(dyn_keep_states)
-static VNET_DEFINE(uma_zone_t, dyn_data_zone);
-static VNET_DEFINE(uma_zone_t, dyn_parent_zone);
-static VNET_DEFINE(uma_zone_t, dyn_ipv4_zone);
+VNET_DEFINE_STATIC(uma_zone_t, dyn_data_zone);
+VNET_DEFINE_STATIC(uma_zone_t, dyn_parent_zone);
+VNET_DEFINE_STATIC(uma_zone_t, dyn_ipv4_zone);
#ifdef INET6
-static VNET_DEFINE(uma_zone_t, dyn_ipv6_zone);
+VNET_DEFINE_STATIC(uma_zone_t, dyn_ipv6_zone);
#define V_dyn_ipv6_zone VNET(dyn_ipv6_zone)
#endif /* INET6 */
#define V_dyn_data_zone VNET(dyn_data_zone)
@@ -328,12 +328,12 @@ static VNET_DEFINE(uma_zone_t, dyn_ipv6_zone);
/*
* Timeouts for various events in handing dynamic rules.
*/
-static VNET_DEFINE(uint32_t, dyn_ack_lifetime);
-static VNET_DEFINE(uint32_t, dyn_syn_lifetime);
-static VNET_DEFINE(uint32_t, dyn_fin_lifetime);
-static VNET_DEFINE(uint32_t, dyn_rst_lifetime);
-static VNET_DEFINE(uint32_t, dyn_udp_lifetime);
-static VNET_DEFINE(uint32_t, dyn_short_lifetime);
+VNET_DEFINE_STATIC(uint32_t, dyn_ack_lifetime);
+VNET_DEFINE_STATIC(uint32_t, dyn_syn_lifetime);
+VNET_DEFINE_STATIC(uint32_t, dyn_fin_lifetime);
+VNET_DEFINE_STATIC(uint32_t, dyn_rst_lifetime);
+VNET_DEFINE_STATIC(uint32_t, dyn_udp_lifetime);
+VNET_DEFINE_STATIC(uint32_t, dyn_short_lifetime);
#define V_dyn_ack_lifetime VNET(dyn_ack_lifetime)
#define V_dyn_syn_lifetime VNET(dyn_syn_lifetime)
@@ -350,20 +350,20 @@ static VNET_DEFINE(uint32_t, dyn_short_lifetime);
* than dyn_keepalive_period.
*/
#define DYN_KEEPALIVE_MAXQ 512
-static VNET_DEFINE(uint32_t, dyn_keepalive_interval);
-static VNET_DEFINE(uint32_t, dyn_keepalive_period);
-static VNET_DEFINE(uint32_t, dyn_keepalive);
-static VNET_DEFINE(time_t, dyn_keepalive_last);
+VNET_DEFINE_STATIC(uint32_t, dyn_keepalive_interval);
+VNET_DEFINE_STATIC(uint32_t, dyn_keepalive_period);
+VNET_DEFINE_STATIC(uint32_t, dyn_keepalive);
+VNET_DEFINE_STATIC(time_t, dyn_keepalive_last);
#define V_dyn_keepalive_interval VNET(dyn_keepalive_interval)
#define V_dyn_keepalive_period VNET(dyn_keepalive_period)
#define V_dyn_keepalive VNET(dyn_keepalive)
#define V_dyn_keepalive_last VNET(dyn_keepalive_last)
-static VNET_DEFINE(uint32_t, dyn_max); /* max # of dynamic states */
-static VNET_DEFINE(uint32_t, dyn_count); /* number of states */
-static VNET_DEFINE(uint32_t, dyn_parent_max); /* max # of parent states */
-static VNET_DEFINE(uint32_t, dyn_parent_count); /* number of parent states */
+VNET_DEFINE_STATIC(uint32_t, dyn_max); /* max # of dynamic states */
+VNET_DEFINE_STATIC(uint32_t, dyn_count); /* number of states */
+VNET_DEFINE_STATIC(uint32_t, dyn_parent_max); /* max # of parent states */
+VNET_DEFINE_STATIC(uint32_t, dyn_parent_count); /* number of parent states */
#define V_dyn_max VNET(dyn_max)
#define V_dyn_count VNET(dyn_count)
@@ -781,7 +781,7 @@ hash_parent(const struct ipfw_flow_id *id, const void *rule)
#else /* IPFIREWALL_JENKINSHASH */
-static VNET_DEFINE(uint32_t, dyn_hashseed);
+VNET_DEFINE_STATIC(uint32_t, dyn_hashseed);
#define V_dyn_hashseed VNET(dyn_hashseed)
static __inline int
diff --git a/sys/netpfil/ipfw/ip_fw_pfil.c b/sys/netpfil/ipfw/ip_fw_pfil.c
index 2e2c99734756..56d5e9f9e780 100644
--- a/sys/netpfil/ipfw/ip_fw_pfil.c
+++ b/sys/netpfil/ipfw/ip_fw_pfil.c
@@ -70,15 +70,15 @@ __FBSDID("$FreeBSD$");
#include <machine/in_cksum.h>
-static VNET_DEFINE(int, fw_enable) = 1;
+VNET_DEFINE_STATIC(int, fw_enable) = 1;
#define V_fw_enable VNET(fw_enable)
#ifdef INET6
-static VNET_DEFINE(int, fw6_enable) = 1;
+VNET_DEFINE_STATIC(int, fw6_enable) = 1;
#define V_fw6_enable VNET(fw6_enable)
#endif
-static VNET_DEFINE(int, fwlink_enable) = 0;
+VNET_DEFINE_STATIC(int, fwlink_enable) = 0;
#define V_fwlink_enable VNET(fwlink_enable)
int ipfw_chg_hook(SYSCTL_HANDLER_ARGS);
diff --git a/sys/netpfil/ipfw/ip_fw_sockopt.c b/sys/netpfil/ipfw/ip_fw_sockopt.c
index b98e71abbec8..f872032c5094 100644
--- a/sys/netpfil/ipfw/ip_fw_sockopt.c
+++ b/sys/netpfil/ipfw/ip_fw_sockopt.c
@@ -183,7 +183,7 @@ static size_t ctl3_rsize;
* static variables followed by global ones
*/
-static VNET_DEFINE(uma_zone_t, ipfw_cntr_zone);
+VNET_DEFINE_STATIC(uma_zone_t, ipfw_cntr_zone);
#define V_ipfw_cntr_zone VNET(ipfw_cntr_zone)
void
diff --git a/sys/netpfil/ipfw/nptv6/nptv6.c b/sys/netpfil/ipfw/nptv6/nptv6.c
index 302560ddaf77..f4724fc683e8 100644
--- a/sys/netpfil/ipfw/nptv6/nptv6.c
+++ b/sys/netpfil/ipfw/nptv6/nptv6.c
@@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$");
#include <netpfil/ipfw/ip_fw_private.h>
#include <netpfil/ipfw/nptv6/nptv6.h>
-static VNET_DEFINE(uint16_t, nptv6_eid) = 0;
+VNET_DEFINE_STATIC(uint16_t, nptv6_eid) = 0;
#define V_nptv6_eid VNET(nptv6_eid)
#define IPFW_TLV_NPTV6_NAME IPFW_TLV_EACTION_NAME(V_nptv6_eid)
diff --git a/sys/netpfil/ipfw/pmod/tcpmod.c b/sys/netpfil/ipfw/pmod/tcpmod.c
index 10b6d2d6a3a3..e9fabff6a046 100644
--- a/sys/netpfil/ipfw/pmod/tcpmod.c
+++ b/sys/netpfil/ipfw/pmod/tcpmod.c
@@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$");
#include <machine/in_cksum.h>
-static VNET_DEFINE(uint16_t, tcpmod_setmss_eid) = 0;
+VNET_DEFINE_STATIC(uint16_t, tcpmod_setmss_eid) = 0;
#define V_tcpmod_setmss_eid VNET(tcpmod_setmss_eid)
static int
diff --git a/sys/netpfil/pf/if_pflog.c b/sys/netpfil/pf/if_pflog.c
index 6c072701457d..87e674f46942 100644
--- a/sys/netpfil/pf/if_pflog.c
+++ b/sys/netpfil/pf/if_pflog.c
@@ -96,7 +96,7 @@ static void pflog_clone_destroy(struct ifnet *);
static const char pflogname[] = "pflog";
-static VNET_DEFINE(struct if_clone *, pflog_cloner);
+VNET_DEFINE_STATIC(struct if_clone *, pflog_cloner);
#define V_pflog_cloner VNET(pflog_cloner)
VNET_DEFINE(struct ifnet *, pflogifs[PFLOGIFS_MAX]); /* for fast access */
diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c
index a2008adbfda3..71d6696d4eff 100644
--- a/sys/netpfil/pf/if_pfsync.c
+++ b/sys/netpfil/pf/if_pfsync.c
@@ -229,13 +229,13 @@ struct pfsync_softc {
static const char pfsyncname[] = "pfsync";
static MALLOC_DEFINE(M_PFSYNC, pfsyncname, "pfsync(4) data");
-static VNET_DEFINE(struct pfsync_softc *, pfsyncif) = NULL;
+VNET_DEFINE_STATIC(struct pfsync_softc *, pfsyncif) = NULL;
#define V_pfsyncif VNET(pfsyncif)
-static VNET_DEFINE(void *, pfsync_swi_cookie) = NULL;
+VNET_DEFINE_STATIC(void *, pfsync_swi_cookie) = NULL;
#define V_pfsync_swi_cookie VNET(pfsync_swi_cookie)
-static VNET_DEFINE(struct pfsyncstats, pfsyncstats);
+VNET_DEFINE_STATIC(struct pfsyncstats, pfsyncstats);
#define V_pfsyncstats VNET(pfsyncstats)
-static VNET_DEFINE(int, pfsync_carp_adj) = CARP_MAXSKEW;
+VNET_DEFINE_STATIC(int, pfsync_carp_adj) = CARP_MAXSKEW;
#define V_pfsync_carp_adj VNET(pfsync_carp_adj)
static void pfsync_timeout(void *);
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index b5039c819537..08eea294b4e2 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -135,7 +135,7 @@ VNET_DEFINE(int, pf_tcp_iss_off);
VNET_DECLARE(int, pf_vnet_active);
#define V_pf_vnet_active VNET(pf_vnet_active)
-static VNET_DEFINE(uint32_t, pf_purge_idx);
+VNET_DEFINE_STATIC(uint32_t, pf_purge_idx);
#define V_pf_purge_idx VNET(pf_purge_idx)
/*
@@ -159,7 +159,7 @@ struct pf_send_entry {
};
STAILQ_HEAD(pf_send_head, pf_send_entry);
-static VNET_DEFINE(struct pf_send_head, pf_sendqueue);
+VNET_DEFINE_STATIC(struct pf_send_head, pf_sendqueue);
#define V_pf_sendqueue VNET(pf_sendqueue)
static struct mtx pf_sendqueue_mtx;
@@ -179,9 +179,9 @@ struct pf_overload_entry {
};
SLIST_HEAD(pf_overload_head, pf_overload_entry);
-static VNET_DEFINE(struct pf_overload_head, pf_overloadqueue);
+VNET_DEFINE_STATIC(struct pf_overload_head, pf_overloadqueue);
#define V_pf_overloadqueue VNET(pf_overloadqueue)
-static VNET_DEFINE(struct task, pf_overloadtask);
+VNET_DEFINE_STATIC(struct task, pf_overloadtask);
#define V_pf_overloadtask VNET(pf_overloadtask)
static struct mtx pf_overloadqueue_mtx;
@@ -195,7 +195,7 @@ struct mtx pf_unlnkdrules_mtx;
MTX_SYSINIT(pf_unlnkdrules_mtx, &pf_unlnkdrules_mtx, "pf unlinked rules",
MTX_DEF);
-static VNET_DEFINE(uma_zone_t, pf_sources_z);
+VNET_DEFINE_STATIC(uma_zone_t, pf_sources_z);
#define V_pf_sources_z VNET(pf_sources_z)
uma_zone_t pf_mtag_z;
VNET_DEFINE(uma_zone_t, pf_state_z);
diff --git a/sys/netpfil/pf/pf_if.c b/sys/netpfil/pf/pf_if.c
index 1c9130fdbbe7..15c19e747c86 100644
--- a/sys/netpfil/pf/pf_if.c
+++ b/sys/netpfil/pf/pf_if.c
@@ -55,16 +55,16 @@ __FBSDID("$FreeBSD$");
#include <net/route.h>
VNET_DEFINE(struct pfi_kif *, pfi_all);
-static VNET_DEFINE(long, pfi_update);
+VNET_DEFINE_STATIC(long, pfi_update);
#define V_pfi_update VNET(pfi_update)
#define PFI_BUFFER_MAX 0x10000
VNET_DECLARE(int, pf_vnet_active);
#define V_pf_vnet_active VNET(pf_vnet_active)
-static VNET_DEFINE(struct pfr_addr *, pfi_buffer);
-static VNET_DEFINE(int, pfi_buffer_cnt);
-static VNET_DEFINE(int, pfi_buffer_max);
+VNET_DEFINE_STATIC(struct pfr_addr *, pfi_buffer);
+VNET_DEFINE_STATIC(int, pfi_buffer_cnt);
+VNET_DEFINE_STATIC(int, pfi_buffer_max);
#define V_pfi_buffer VNET(pfi_buffer)
#define V_pfi_buffer_cnt VNET(pfi_buffer_cnt)
#define V_pfi_buffer_max VNET(pfi_buffer_max)
@@ -98,14 +98,14 @@ static void pfi_ifaddr_event(void * __unused, struct ifnet *);
RB_HEAD(pfi_ifhead, pfi_kif);
static RB_PROTOTYPE(pfi_ifhead, pfi_kif, pfik_tree, pfi_if_compare);
static RB_GENERATE(pfi_ifhead, pfi_kif, pfik_tree, pfi_if_compare);
-static VNET_DEFINE(struct pfi_ifhead, pfi_ifs);
+VNET_DEFINE_STATIC(struct pfi_ifhead, pfi_ifs);
#define V_pfi_ifs VNET(pfi_ifs)
#define PFI_BUFFER_MAX 0x10000
MALLOC_DEFINE(PFI_MTYPE, "pf_ifnet", "pf(4) interface database");
LIST_HEAD(pfi_list, pfi_kif);
-static VNET_DEFINE(struct pfi_list, pfi_unlinked_kifs);
+VNET_DEFINE_STATIC(struct pfi_list, pfi_unlinked_kifs);
#define V_pfi_unlinked_kifs VNET(pfi_unlinked_kifs)
static struct mtx pfi_unlnkdkifs_mtx;
MTX_SYSINIT(pfi_unlnkdkifs_mtx, &pfi_unlnkdkifs_mtx, "pf unlinked interfaces",
diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c
index 381e349e96c3..fa2c2d131d13 100644
--- a/sys/netpfil/pf/pf_ioctl.c
+++ b/sys/netpfil/pf/pf_ioctl.c
@@ -117,7 +117,7 @@ static void pf_addr_copyout(struct pf_addr_wrap *);
VNET_DEFINE(struct pf_rule, pf_default_rule);
#ifdef ALTQ
-static VNET_DEFINE(int, pf_altq_running);
+VNET_DEFINE_STATIC(int, pf_altq_running);
#define V_pf_altq_running VNET(pf_altq_running)
#endif
@@ -187,7 +187,7 @@ static struct cdevsw pf_cdevsw = {
.d_version = D_VERSION,
};
-static volatile VNET_DEFINE(int, pf_pfil_hooked);
+volatile VNET_DEFINE_STATIC(int, pf_pfil_hooked);
#define V_pf_pfil_hooked VNET(pf_pfil_hooked)
/*
diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c
index 719f64f4f22c..5e8598e9758f 100644
--- a/sys/netpfil/pf/pf_norm.c
+++ b/sys/netpfil/pf/pf_norm.c
@@ -109,17 +109,17 @@ MTX_SYSINIT(pf_frag_mtx, &pf_frag_mtx, "pf fragments", MTX_DEF);
VNET_DEFINE(uma_zone_t, pf_state_scrub_z); /* XXX: shared with pfsync */
-static VNET_DEFINE(uma_zone_t, pf_frent_z);
+VNET_DEFINE_STATIC(uma_zone_t, pf_frent_z);
#define V_pf_frent_z VNET(pf_frent_z)
-static VNET_DEFINE(uma_zone_t, pf_frag_z);
+VNET_DEFINE_STATIC(uma_zone_t, pf_frag_z);
#define V_pf_frag_z VNET(pf_frag_z)
TAILQ_HEAD(pf_fragqueue, pf_fragment);
TAILQ_HEAD(pf_cachequeue, pf_fragment);
-static VNET_DEFINE(struct pf_fragqueue, pf_fragqueue);
+VNET_DEFINE_STATIC(struct pf_fragqueue, pf_fragqueue);
#define V_pf_fragqueue VNET(pf_fragqueue)
RB_HEAD(pf_frag_tree, pf_fragment);
-static VNET_DEFINE(struct pf_frag_tree, pf_frag_tree);
+VNET_DEFINE_STATIC(struct pf_frag_tree, pf_frag_tree);
#define V_pf_frag_tree VNET(pf_frag_tree)
static int pf_frag_compare(struct pf_fragment *,
struct pf_fragment *);
diff --git a/sys/netpfil/pf/pf_osfp.c b/sys/netpfil/pf/pf_osfp.c
index 55ee7785267b..e00cce5c4d36 100644
--- a/sys/netpfil/pf/pf_osfp.c
+++ b/sys/netpfil/pf/pf_osfp.c
@@ -47,7 +47,7 @@ static MALLOC_DEFINE(M_PFOSFP, "pf_osfp", "pf(4) operating system fingerprints")
printf(format , ##x)
SLIST_HEAD(pf_osfp_list, pf_os_fingerprint);
-static VNET_DEFINE(struct pf_osfp_list, pf_osfp_list) =
+VNET_DEFINE_STATIC(struct pf_osfp_list, pf_osfp_list) =
SLIST_HEAD_INITIALIZER();
#define V_pf_osfp_list VNET(pf_osfp_list)
diff --git a/sys/netpfil/pf/pf_table.c b/sys/netpfil/pf/pf_table.c
index 0a8925962456..0e43c0b846c8 100644
--- a/sys/netpfil/pf/pf_table.c
+++ b/sys/netpfil/pf/pf_table.c
@@ -122,9 +122,9 @@ struct pfr_walktree {
#define senderr(e) do { rv = (e); goto _bad; } while (0)
static MALLOC_DEFINE(M_PFTABLE, "pf_table", "pf(4) tables structures");
-static VNET_DEFINE(uma_zone_t, pfr_kentry_z);
+VNET_DEFINE_STATIC(uma_zone_t, pfr_kentry_z);
#define V_pfr_kentry_z VNET(pfr_kentry_z)
-static VNET_DEFINE(uma_zone_t, pfr_kcounters_z);
+VNET_DEFINE_STATIC(uma_zone_t, pfr_kcounters_z);
#define V_pfr_kcounters_z VNET(pfr_kcounters_z)
static struct pf_addr pfr_ffaddr = {
@@ -184,13 +184,13 @@ static struct pfr_kentry
static RB_PROTOTYPE(pfr_ktablehead, pfr_ktable, pfrkt_tree, pfr_ktable_compare);
static RB_GENERATE(pfr_ktablehead, pfr_ktable, pfrkt_tree, pfr_ktable_compare);
-static VNET_DEFINE(struct pfr_ktablehead, pfr_ktables);
+VNET_DEFINE_STATIC(struct pfr_ktablehead, pfr_ktables);
#define V_pfr_ktables VNET(pfr_ktables)
-static VNET_DEFINE(struct pfr_table, pfr_nulltable);
+VNET_DEFINE_STATIC(struct pfr_table, pfr_nulltable);
#define V_pfr_nulltable VNET(pfr_nulltable)
-static VNET_DEFINE(int, pfr_ktable_cnt);
+VNET_DEFINE_STATIC(int, pfr_ktable_cnt);
#define V_pfr_ktable_cnt VNET(pfr_ktable_cnt)
void