aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Elischer <julian@FreeBSD.org>2009-08-21 09:22:32 +0000
committerJulian Elischer <julian@FreeBSD.org>2009-08-21 09:22:32 +0000
commitcd81cd3fd1f57ef36b84e59181b1a29fb77b7936 (patch)
treeeb3fd64c5ebdefe1e727afc35be37f5acf1a4346
parenteb5a1e8f38a4cf29a77ac42812356460d5e8cf78 (diff)
downloadsrc-cd81cd3fd1f57ef36b84e59181b1a29fb77b7936.tar.gz
src-cd81cd3fd1f57ef36b84e59181b1a29fb77b7936.zip
Don't allow access to the internals until it has all been set up.
Specifically, not until the per-vnet parts have been set up. Submitted by: kmacy@ Reviewed by: julian@, zec@ Approved by: re(rwatson) MFC after: immediately
Notes
Notes: svn path=/head/; revision=196419
-rw-r--r--sys/net/flowtable.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/net/flowtable.c b/sys/net/flowtable.c
index f6cd77839bc6..98127edd5b29 100644
--- a/sys/net/flowtable.c
+++ b/sys/net/flowtable.c
@@ -999,6 +999,7 @@ flowtable_init_vnet(const void *unused __unused)
NULL, NULL, NULL, NULL, 64, UMA_ZONE_MAXBUCKET);
uma_zone_set_max(V_flow_ipv4_zone, V_flowtable_nmbflows);
uma_zone_set_max(V_flow_ipv6_zone, V_flowtable_nmbflows);
+ V_flowtable_ready = 1;
}
VNET_SYSINIT(flowtable_init_vnet, SI_SUB_KTHREAD_INIT, SI_ORDER_MIDDLE,
flowtable_init_vnet, NULL);
@@ -1011,7 +1012,6 @@ flowtable_init(const void *unused __unused)
mtx_init(&flowclean_lock, "flowclean lock", NULL, MTX_DEF);
EVENTHANDLER_REGISTER(ifnet_departure_event, flowtable_flush, NULL,
EVENTHANDLER_PRI_ANY);
- V_flowtable_ready = 1;
}
SYSINIT(flowtable_init, SI_SUB_KTHREAD_INIT, SI_ORDER_ANY,
flowtable_init, NULL);
@@ -1022,6 +1022,7 @@ static void
flowtable_uninit(const void *unused __unused)
{
+ V_flowtable_ready = 0;
uma_zdestroy(V_flow_ipv4_zone);
uma_zdestroy(V_flow_ipv6_zone);
}