summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/nd6_rtr.c
diff options
context:
space:
mode:
authorzec <zec@FreeBSD.org>2008-11-19 09:39:34 +0000
committerzec <zec@FreeBSD.org>2008-11-19 09:39:34 +0000
commit815d52c5df6a76286604478e5223d2f2c87b2c04 (patch)
tree3d398563f1e14b804a0558dd3dda1de9a42b9970 /sys/netinet6/nd6_rtr.c
parent881f5acc93790d49318ffde65d52c6f45ca9c1f8 (diff)
downloadFreeBSD-src-815d52c5df6a76286604478e5223d2f2c87b2c04.zip
FreeBSD-src-815d52c5df6a76286604478e5223d2f2c87b2c04.tar.gz
Change the initialization methodology for global variables scheduled
for virtualization. Instead of initializing the affected global variables at instatiation, assign initial values to them in initializer functions. As a rule, initialization at instatiation for such variables should never be introduced again from now on. Furthermore, enclose all instantiations of such global variables in #ifdef VIMAGE_GLOBALS blocks. Essentialy, this change should have zero functional impact. In the next phase of merging network stack virtualization infrastructure from p4/vimage branch, the new initialization methology will allow us to switch between using global variables and their counterparts residing in virtualization containers with minimum code churn, and in the long run allow us to intialize multiple instances of such container structures. Discussed at: devsummit Strassburg Reviewed by: bz, julian Approved by: julian (mentor) Obtained from: //depot/projects/vimage-commit2/... X-MFC after: never Sponsored by: NLnet Foundation, The FreeBSD Foundation
Diffstat (limited to 'sys/netinet6/nd6_rtr.c')
-rw-r--r--sys/netinet6/nd6_rtr.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c
index a1f891b..31f06a7 100644
--- a/sys/netinet6/nd6_rtr.c
+++ b/sys/netinet6/nd6_rtr.c
@@ -87,20 +87,16 @@ static int rt6_deleteroute(struct radix_node *, void *);
extern int nd6_recalc_reachtm_interval;
+#ifdef VIMAGE_GLOBALS
static struct ifnet *nd6_defifp;
int nd6_defifindex;
-int ip6_use_tempaddr = 0;
-
+int ip6_use_tempaddr;
int ip6_desync_factor;
-u_int32_t ip6_temp_preferred_lifetime = DEF_TEMP_PREFERRED_LIFETIME;
-u_int32_t ip6_temp_valid_lifetime = DEF_TEMP_VALID_LIFETIME;
-/*
- * shorter lifetimes for debugging purposes.
-int ip6_temp_preferred_lifetime = 800;
-static int ip6_temp_valid_lifetime = 1800;
-*/
-int ip6_temp_regen_advance = TEMPADDR_REGEN_ADVANCE;
+u_int32_t ip6_temp_preferred_lifetime;
+u_int32_t ip6_temp_valid_lifetime;
+int ip6_temp_regen_advance;
+#endif
/* RTPREF_MEDIUM has to be 0! */
#define RTPREF_HIGH 1
OpenPOWER on IntegriCloud