diff options
author | zec <zec@FreeBSD.org> | 2008-11-19 09:39:34 +0000 |
---|---|---|
committer | zec <zec@FreeBSD.org> | 2008-11-19 09:39:34 +0000 |
commit | 815d52c5df6a76286604478e5223d2f2c87b2c04 (patch) | |
tree | 3d398563f1e14b804a0558dd3dda1de9a42b9970 /sys/netipsec/xform_ipip.c | |
parent | 881f5acc93790d49318ffde65d52c6f45ca9c1f8 (diff) | |
download | FreeBSD-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/netipsec/xform_ipip.c')
-rw-r--r-- | sys/netipsec/xform_ipip.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/netipsec/xform_ipip.c b/sys/netipsec/xform_ipip.c index 568d42e..610f984 100644 --- a/sys/netipsec/xform_ipip.c +++ b/sys/netipsec/xform_ipip.c @@ -91,8 +91,10 @@ * We can control the acceptance of IP4 packets by altering the sysctl * net.inet.ipip.allow value. Zero means drop them, all else is acceptance. */ -int ipip_allow = 0; +#ifdef VIMAGE_GLOBALS +int ipip_allow; struct ipipstat ipipstat; +#endif SYSCTL_DECL(_net_inet_ipip); SYSCTL_V_INT(V_NET, vnet_ipsec, _net_inet_ipip, OID_AUTO, @@ -694,6 +696,9 @@ ipe4_encapcheck(const struct mbuf *m, int off, int proto, void *arg) static void ipe4_attach(void) { + + V_ipip_allow = 0; + xform_register(&ipe4_xformsw); /* attach to encapsulation framework */ /* XXX save return cookie for detach on module remove */ |