diff options
author | glebius <glebius@FreeBSD.org> | 2011-12-20 12:34:16 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2011-12-20 12:34:16 +0000 |
commit | 160dea21a58f6a9b4a693b6565aef2bd7b98c0c1 (patch) | |
tree | 19c3e5e0d7fc1f6648859459b92086c5df2d1f12 | |
parent | cb7060fb0090efad0fe7704e6ab3c8c43aa1ab3f (diff) | |
download | FreeBSD-src-160dea21a58f6a9b4a693b6565aef2bd7b98c0c1.zip FreeBSD-src-160dea21a58f6a9b4a693b6565aef2bd7b98c0c1.tar.gz |
- Cover pfsync callouts deletion with PF_LOCK().
- Cover setting up interface between pf and pfsync with PF_LOCK().
-rw-r--r-- | sys/contrib/pf/net/if_pfsync.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/contrib/pf/net/if_pfsync.c b/sys/contrib/pf/net/if_pfsync.c index f60f70b..a8e5fa9 100644 --- a/sys/contrib/pf/net/if_pfsync.c +++ b/sys/contrib/pf/net/if_pfsync.c @@ -539,9 +539,13 @@ pfsync_clone_destroy(struct ifnet *ifp) #ifdef __FreeBSD__ EVENTHANDLER_DEREGISTER(ifnet_departure_event, sc->sc_detachtag); + PF_LOCK(); #endif - timeout_del(&sc->sc_bulk_tmo); /* XXX: need PF_LOCK() before */ + timeout_del(&sc->sc_bulk_tmo); timeout_del(&sc->sc_tmo); +#ifdef __FreeBSD__ + PF_UNLOCK(); +#endif #if NCARP > 0 #ifdef notyet #ifdef __FreeBSD__ @@ -3392,6 +3396,7 @@ vnet_pfsync_init(const void *unused) if (error) panic("%s: swi_add %d", __func__, error); + PF_LOCK(); pfsync_state_import_ptr = pfsync_state_import; pfsync_up_ptr = pfsync_up; pfsync_insert_state_ptr = pfsync_insert_state; @@ -3400,6 +3405,7 @@ vnet_pfsync_init(const void *unused) pfsync_clear_states_ptr = pfsync_clear_states; pfsync_state_in_use_ptr = pfsync_state_in_use; pfsync_defer_ptr = pfsync_defer; + PF_UNLOCK(); return (0); } @@ -3410,6 +3416,7 @@ vnet_pfsync_uninit(const void *unused) swi_remove(pfsync_swi.pfsync_swi_cookie); + PF_LOCK(); pfsync_state_import_ptr = NULL; pfsync_up_ptr = NULL; pfsync_insert_state_ptr = NULL; @@ -3418,6 +3425,7 @@ vnet_pfsync_uninit(const void *unused) pfsync_clear_states_ptr = NULL; pfsync_state_in_use_ptr = NULL; pfsync_defer_ptr = NULL; + PF_UNLOCK(); if_clone_detach(&pfsync_cloner); |