summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/icmp6.c
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/netinet6/icmp6.c
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/netinet6/icmp6.c')
-rw-r--r--sys/netinet6/icmp6.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index 57f8d32..87df9c3 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -113,23 +113,22 @@ __FBSDID("$FreeBSD$");
extern struct domain inet6domain;
+VNET_DEFINE(struct icmp6stat, 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_DECLARE(int, icmp6_nodeinfo);
#define V_ripcbinfo VNET(ripcbinfo)
#define V_ripcb VNET(ripcb)
#define V_icmp6errppslim VNET(icmp6errppslim)
+#define V_icmp6errpps_count VNET(icmp6errpps_count)
+#define V_icmp6errppslim_last VNET(icmp6errppslim_last)
#define V_icmp6_nodeinfo VNET(icmp6_nodeinfo)
-VNET_DEFINE(struct icmp6stat, icmp6stat);
-static VNET_DEFINE(int, icmp6errpps_count);
-static VNET_DEFINE(struct timeval, icmp6errppslim_last);
-
-#define V_icmp6errpps_count VNET(icmp6errpps_count)
-#define V_icmp6errppslim_last VNET(icmp6errppslim_last)
-
static void icmp6_errcount(struct icmp6errstat *, int, int);
static int icmp6_rip6_input(struct mbuf **, int);
static int icmp6_ratelimit(const struct in6_addr *, const int, const int);
@@ -144,14 +143,6 @@ static int ni6_store_addrs __P((struct icmp6_nodeinfo *, struct icmp6_nodeinfo *
struct ifnet *, int));
static int icmp6_notify_error(struct mbuf **, int, int, int);
-
-void
-icmp6_init(void)
-{
-
- V_icmp6errpps_count = 0;
-}
-
/*
* Kernel module interface for updating icmp6stat. The argument is an index
* into icmp6stat treated as an array of u_quad_t. While this encodes the
OpenPOWER on IntegriCloud