summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/nd6.c
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2010-05-06 06:44:19 +0000
committerbz <bz@FreeBSD.org>2010-05-06 06:44:19 +0000
commit70e6f14e44387c54e20403484badf917d9b74589 (patch)
tree5305eacadb412df61b0d8de24da9051c2210f495 /sys/netinet6/nd6.c
parent3e52c1f894aa8fc2b8031ef275b1fb830a25bb6f (diff)
downloadFreeBSD-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/nd6.c')
-rw-r--r--sys/netinet6/nd6.c77
1 files changed, 22 insertions, 55 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index 8e7d10e..30efbf0 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -81,21 +81,31 @@ __FBSDID("$FreeBSD$");
#define SIN6(s) ((struct sockaddr_in6 *)s)
-VNET_DEFINE(int, nd6_prune);
-VNET_DEFINE(int, nd6_delay);
-VNET_DEFINE(int, nd6_umaxtries);
-VNET_DEFINE(int, nd6_mmaxtries);
-VNET_DEFINE(int, nd6_useloopback);
-VNET_DEFINE(int, nd6_gctimer);
+/* timer values */
+VNET_DEFINE(int, nd6_prune) = 1; /* walk list every 1 seconds */
+VNET_DEFINE(int, nd6_delay) = 5; /* delay first probe time 5 second */
+VNET_DEFINE(int, nd6_umaxtries) = 3; /* maximum unicast query */
+VNET_DEFINE(int, nd6_mmaxtries) = 3; /* maximum multicast query */
+VNET_DEFINE(int, nd6_useloopback) = 1; /* use loopback interface for
+ * local traffic */
+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);
-VNET_DEFINE(int, nd6_maxnudhint);
-static VNET_DEFINE(int, nd6_maxqueuelen);
+static VNET_DEFINE(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
+ * ND entries */
#define V_nd6_maxndopt VNET(nd6_maxndopt)
#define V_nd6_maxqueuelen VNET(nd6_maxqueuelen)
-VNET_DEFINE(int, nd6_debug);
+#ifdef ND6_DEBUG
+VNET_DEFINE(int, nd6_debug) = 1;
+#else
+VNET_DEFINE(int, nd6_debug) = 0;
+#endif
/* for debugging? */
#if 0
@@ -105,7 +115,7 @@ static int nd6_inuse, nd6_allocated;
VNET_DEFINE(struct nd_drhead, nd_defrouter);
VNET_DEFINE(struct nd_prhead, nd_prefix);
-VNET_DEFINE(int, nd6_recalc_reachtm_interval);
+VNET_DEFINE(int, nd6_recalc_reachtm_interval) = ND6_RECALC_REACHTM_INTERVAL;
#define V_nd6_recalc_reachtm_interval VNET(nd6_recalc_reachtm_interval)
static struct sockaddr_in6 all1_sa;
@@ -124,56 +134,13 @@ static VNET_DEFINE(struct callout, nd6_slowtimo_ch);
VNET_DEFINE(struct callout, nd6_timer_ch);
-VNET_DECLARE(int, dad_ignore_ns);
-VNET_DECLARE(int, dad_maxtry);
-#define V_dad_ignore_ns VNET(dad_ignore_ns)
-#define V_dad_maxtry VNET(dad_maxtry)
-
void
nd6_init(void)
{
int i;
- V_nd6_prune = 1; /* walk list every 1 seconds */
- V_nd6_delay = 5; /* delay first probe time 5 second */
- V_nd6_umaxtries = 3; /* maximum unicast query */
- V_nd6_mmaxtries = 3; /* maximum multicast query */
- V_nd6_useloopback = 1; /* use loopback interface for local traffic */
- V_nd6_gctimer = (60 * 60 * 24); /* 1 day: garbage collection timer */
-
- /* preventing too many loops in ND option parsing */
- V_nd6_maxndopt = 10; /* max # of ND options allowed */
-
- V_nd6_maxnudhint = 0; /* max # of subsequent upper layer hints */
- V_nd6_maxqueuelen = 1; /* max pkts cached in unresolved ND entries */
-
-#ifdef ND6_DEBUG
- V_nd6_debug = 1;
-#else
- V_nd6_debug = 0;
-#endif
-
- V_nd6_recalc_reachtm_interval = ND6_RECALC_REACHTM_INTERVAL;
-
- V_dad_ignore_ns = 0; /* ignore NS in DAD - specwise incorrect*/
- V_dad_maxtry = 15; /* max # of *tries* to transmit DAD packet */
-
- /*
- * XXX just to get this to compile KMM
- */
-#ifdef notyet
- V_llinfo_nd6.ln_next = &V_llinfo_nd6;
- V_llinfo_nd6.ln_prev = &V_llinfo_nd6;
-#endif
LIST_INIT(&V_nd_prefix);
- V_ip6_use_tempaddr = 0;
- V_ip6_temp_preferred_lifetime = DEF_TEMP_PREFERRED_LIFETIME;
- V_ip6_temp_valid_lifetime = DEF_TEMP_VALID_LIFETIME;
- V_ip6_temp_regen_advance = TEMPADDR_REGEN_ADVANCE;
-
- V_ip6_desync_factor = 0;
-
all1_sa.sin6_family = AF_INET6;
all1_sa.sin6_len = sizeof(struct sockaddr_in6);
for (i = 0; i < sizeof(all1_sa.sin6_addr); i++)
@@ -181,13 +148,13 @@ nd6_init(void)
/* initialization of the default router list */
TAILQ_INIT(&V_nd_defrouter);
+
/* start timer */
callout_init(&V_nd6_slowtimo_ch, 0);
callout_reset(&V_nd6_slowtimo_ch, ND6_SLOWTIMER_INTERVAL * hz,
nd6_slowtimo, curvnet);
}
-
#ifdef VIMAGE
void
nd6_destroy()
OpenPOWER on IntegriCloud