summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2010-04-29 11:52:42 +0000
committerbz <bz@FreeBSD.org>2010-04-29 11:52:42 +0000
commit0a90ef17283bc848eee90c3bdd5bec3fcc1bc879 (patch)
treee6f9695e24617b291f2a8f0b1f388eda2e605549 /sys/net
parent043deeb56455e1129861bf93ec57f03b90200344 (diff)
downloadFreeBSD-src-0a90ef17283bc848eee90c3bdd5bec3fcc1bc879.zip
FreeBSD-src-0a90ef17283bc848eee90c3bdd5bec3fcc1bc879.tar.gz
MFP4: @176978-176982, 176984, 176990-176994, 177441
"Whitspace" churn after the VIMAGE/VNET whirls. Remove the need for some "init" functions within the network stack, like pim6_init(), icmp_init() or significantly shorten others like ip6_init() and nd6_init(), using static initialization again where possible and formerly missed. Move (most) variables back to the place they used to be before the container structs and VIMAGE_GLOABLS (before r185088) and try to reduce the diff to stable/7 and earlier as good as possible, to help out-of-tree consumers to update from 6.x or 7.x to 8 or 9. This also removes some header file pollution for putatively static global variables. Revert VIMAGE specific changes in ipfilter::ip_auth.c, that are no longer needed. Reviewed by: jhb Discussed with: rwatson Sponsored by: The FreeBSD Foundation Sponsored by: CK Software GmbH MFC after: 6 days
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if.c6
-rw-r--r--sys/net/if_gif.c20
-rw-r--r--sys/net/if_gif.h4
-rw-r--r--sys/net/route.c12
4 files changed, 10 insertions, 32 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 98c8afa..1acfb24 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -163,9 +163,11 @@ static void if_detach_internal(struct ifnet *, int);
extern void nd6_setmtu(struct ifnet *);
#endif
+VNET_DEFINE(int, if_index);
+int ifqmaxlen = IFQ_MAXLEN;
VNET_DEFINE(struct ifnethead, ifnet); /* depend on static init XXX */
VNET_DEFINE(struct ifgrouphead, ifg_head);
-VNET_DEFINE(int, if_index);
+
static VNET_DEFINE(int, if_indexlim) = 8;
/* Table of ifnet by index. */
@@ -174,8 +176,6 @@ static VNET_DEFINE(struct ifindex_entry *, ifindex_table);
#define V_if_indexlim VNET(if_indexlim)
#define V_ifindex_table VNET(ifindex_table)
-int ifqmaxlen = IFQ_MAXLEN;
-
/*
* The global network interface list (V_ifnet) and related state (such as
* if_index, if_indexlim, and ifindex_table) are protected by an sxlock and
diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c
index 22ef6ab..ae0ff4e 100644
--- a/sys/net/if_gif.c
+++ b/sys/net/if_gif.c
@@ -94,20 +94,9 @@
*/
static struct mtx gif_mtx;
static MALLOC_DEFINE(M_GIF, "gif", "Generic Tunnel Interface");
-
static VNET_DEFINE(LIST_HEAD(, gif_softc), gif_softc_list);
-
#define V_gif_softc_list VNET(gif_softc_list)
-#ifdef INET
-VNET_DEFINE(int, ip_gif_ttl) = GIF_TTL;
-#define V_ip_gif_ttl VNET(ip_gif_ttl)
-#endif
-#ifdef INET6
-VNET_DEFINE(int, ip6_gif_hlim) = GIF_HLIM;
-#define V_ip6_gif_hlim VNET(ip6_gif_hlim)
-#endif
-
void (*ng_gif_input_p)(struct ifnet *ifp, struct mbuf **mp, int af);
void (*ng_gif_input_orphan_p)(struct ifnet *ifp, struct mbuf *m, int af);
void (*ng_gif_attach_p)(struct ifnet *ifp);
@@ -135,19 +124,11 @@ 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;
#define V_max_gif_nesting VNET(max_gif_nesting)
-
SYSCTL_VNET_INT(_net_link_gif, OID_AUTO, max_nesting, CTLFLAG_RW,
&VNET_NAME(max_gif_nesting), 0, "Max nested tunnels");
-#ifdef INET6
-SYSCTL_DECL(_net_inet6_ip6);
-SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_GIF_HLIM, gifhlim, CTLFLAG_RW,
- &VNET_NAME(ip6_gif_hlim), 0, "");
-#endif
-
/*
* By default, we disallow creation of multiple tunnels between the same
* pair of addresses. Some applications require this functionality so
@@ -159,7 +140,6 @@ static VNET_DEFINE(int, parallel_tunnels) = 1;
static VNET_DEFINE(int, parallel_tunnels) = 0;
#endif
#define V_parallel_tunnels VNET(parallel_tunnels)
-
SYSCTL_VNET_INT(_net_link_gif, OID_AUTO, parallel_tunnels, CTLFLAG_RW,
&VNET_NAME(parallel_tunnels), 0, "Allow parallel tunnels?");
diff --git a/sys/net/if_gif.h b/sys/net/if_gif.h
index 18b7831..5d0db6d 100644
--- a/sys/net/if_gif.h
+++ b/sys/net/if_gif.h
@@ -118,10 +118,6 @@ int gif_ioctl(struct ifnet *, u_long, caddr_t);
int gif_set_tunnel(struct ifnet *, struct sockaddr *, struct sockaddr *);
void gif_delete_tunnel(struct ifnet *);
int gif_encapcheck(const struct mbuf *, int, int, void *);
-
-VNET_DECLARE(int, ip_gif_ttl);
-#define V_ip_gif_ttl VNET(ip_gif_ttl)
-
#endif /* _KERNEL */
#define GIFGOPTS _IOWR('i', 150, struct ifreq)
diff --git a/sys/net/route.c b/sys/net/route.c
index e500ed1..b45361e 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -88,15 +88,14 @@ SYSCTL_INT(_net, OID_AUTO, add_addr_allfibs, CTLFLAG_RW,
&rt_add_addr_allfibs, 0, "");
TUNABLE_INT("net.add_addr_allfibs", &rt_add_addr_allfibs);
-VNET_DEFINE(struct radix_node_head *, rt_tables);
-static VNET_DEFINE(uma_zone_t, rtzone); /* Routing table UMA zone. */
-VNET_DEFINE(int, rttrash); /* routes not in table but not freed */
VNET_DEFINE(struct rtstat, rtstat);
+#define V_rtstat VNET(rtstat)
+VNET_DEFINE(struct radix_node_head *, rt_tables);
#define V_rt_tables VNET(rt_tables)
-#define V_rtzone VNET(rtzone)
+
+VNET_DEFINE(int, rttrash); /* routes not in table but not freed */
#define V_rttrash VNET(rttrash)
-#define V_rtstat VNET(rtstat)
/* compare two sockaddr structures */
@@ -114,6 +113,9 @@ VNET_DEFINE(struct rtstat, rtstat);
*/
#define RNTORT(p) ((struct rtentry *)(p))
+static VNET_DEFINE(uma_zone_t, rtzone); /* Routing table UMA zone. */
+#define V_rtzone VNET(rtzone)
+
#if 0
/* default fib for tunnels to use */
u_int tunnel_fib = 0;
OpenPOWER on IntegriCloud