diff options
author | Marko Zec <zec@FreeBSD.org> | 2008-11-19 09:39:34 +0000 |
---|---|---|
committer | Marko Zec <zec@FreeBSD.org> | 2008-11-19 09:39:34 +0000 |
commit | 44e33a075818146eb289c39c3ca2817f54517c9f (patch) | |
tree | 3d398563f1e14b804a0558dd3dda1de9a42b9970 /sys/netipsec/keysock.c | |
parent | 6f0e1ffd076c821819632e0371db2f38434ad02c (diff) | |
download | src-44e33a075818146eb289c39c3ca2817f54517c9f.tar.gz src-44e33a075818146eb289c39c3ca2817f54517c9f.zip |
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
Notes
Notes:
svn path=/head/; revision=185088
Diffstat (limited to 'sys/netipsec/keysock.c')
-rw-r--r-- | sys/netipsec/keysock.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/netipsec/keysock.c b/sys/netipsec/keysock.c index 882aed4112b2..6d5c4bcfc791 100644 --- a/sys/netipsec/keysock.c +++ b/sys/netipsec/keysock.c @@ -70,14 +70,16 @@ struct key_cb { int key_count; int any_count; }; + +#ifdef VIMAGE_GLOBALS static struct key_cb key_cb; +struct pfkeystat pfkeystat; +#endif static struct sockaddr key_src = { 2, PF_KEY, }; static int key_sendup0 __P((struct rawcb *, struct mbuf *, int)); -struct pfkeystat pfkeystat; - /* * key_output() */ @@ -570,7 +572,9 @@ static void key_init0(void) { INIT_VNET_IPSEC(curvnet); + bzero((caddr_t)&V_key_cb, sizeof(V_key_cb)); + ipsec_init(); key_init(); } |