if_wg: do not crash if deiniting before vnet is up
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
0955fa72f5
commit
7855bfe930
|
@ -3037,7 +3037,10 @@ wg_module_deinit(void)
|
|||
VNET_ITERATOR_DECL(vnet_iter);
|
||||
VNET_LIST_RLOCK();
|
||||
VNET_FOREACH(vnet_iter) {
|
||||
if_clone_detach(VNET_VNET(vnet_iter, wg_cloner));
|
||||
struct if_clone *clone = VNET_VNET(vnet_iter, wg_cloner);
|
||||
if (!clone)
|
||||
continue;
|
||||
if_clone_detach(clone);
|
||||
VNET_VNET(vnet_iter, wg_cloner) = NULL;
|
||||
}
|
||||
VNET_LIST_RUNLOCK();
|
||||
|
|
|
@ -94,11 +94,11 @@ cookie_init(void)
|
|||
void
|
||||
cookie_deinit(void)
|
||||
{
|
||||
uma_zdestroy(ratelimit_zone);
|
||||
ratelimit_deinit(&ratelimit_v4);
|
||||
#ifdef INET6
|
||||
ratelimit_deinit(&ratelimit_v6);
|
||||
#endif
|
||||
uma_zdestroy(ratelimit_zone);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in New Issue