diff options
author | bz <bz@FreeBSD.org> | 2010-05-06 06:44:19 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2010-05-06 06:44:19 +0000 |
commit | 70e6f14e44387c54e20403484badf917d9b74589 (patch) | |
tree | 5305eacadb412df61b0d8de24da9051c2210f495 /sys/netinet6/ip6_mroute.c | |
parent | 3e52c1f894aa8fc2b8031ef275b1fb830a25bb6f (diff) | |
download | FreeBSD-src-70e6f14e44387c54e20403484badf917d9b74589.zip FreeBSD-src-70e6f14e44387c54e20403484badf917d9b74589.tar.gz |
MFC r207369:
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
Diffstat (limited to 'sys/netinet6/ip6_mroute.c')
-rw-r--r-- | sys/netinet6/ip6_mroute.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index 5496062..0c1ff78 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -130,7 +130,6 @@ static MALLOC_DEFINE(M_MRTABLE6, "mf6c", "multicast forwarding cache entry"); static int ip6_mdq(struct mbuf *, struct ifnet *, struct mf6c *); static void phyint_send(struct ip6_hdr *, struct mif6 *, struct mbuf *); -static void pim6_init(void); static int register_send(struct ip6_hdr *, struct mif6 *, struct mbuf *); static int set_pim6(int *); static int socket_send(struct socket *, struct mbuf *, @@ -148,12 +147,11 @@ static const struct ip6protosw in6_pim_protosw = { .pr_input = pim6_input, .pr_output = rip6_output, .pr_ctloutput = rip6_ctloutput, - .pr_init = pim6_init, .pr_usrreqs = &rip6_usrreqs }; static int pim6_encapcheck(const struct mbuf *, int, int, void *); -static VNET_DEFINE(int, ip6_mrouter_ver); +static VNET_DEFINE(int, ip6_mrouter_ver) = 0; #define V_ip6_mrouter_ver VNET(ip6_mrouter_ver) SYSCTL_DECL(_net_inet6); @@ -212,7 +210,7 @@ static struct mtx mif6_mtx; #define MIF6_LOCK_DESTROY() mtx_destroy(&mif6_mtx) #ifdef MRT6DEBUG -static VNET_DEFINE(u_int, mrt6debug); /* debug level */ +static VNET_DEFINE(u_int, mrt6debug) = 0; /* debug level */ #define V_mrt6debug VNET(mrt6debug) #define DEBUG_MFC 0x02 #define DEBUG_FORWARD 0x04 @@ -338,15 +336,6 @@ int X_ip6_mrouter_set(struct socket *, struct sockopt *); int X_ip6_mrouter_get(struct socket *, struct sockopt *); int X_mrt6_ioctl(u_long, caddr_t); -static void -pim6_init(void) -{ - -#ifdef MRT6DEBUG - V_mrt6debug = 0; /* debug level */ -#endif -} - /* * Handle MRT setsockopt commands to modify the multicast routing tables. */ @@ -533,11 +522,7 @@ static int ip6_mrouter_init(struct socket *so, int v, int cmd) { - V_ip6_mrouter_ver = 0; - #ifdef MRT6DEBUG - V_mrt6debug = 0; - if (V_mrt6debug) log(LOG_DEBUG, "ip6_mrouter_init: so_type = %d, pr_protocol = %d\n", |