aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/if_wg.c5
-rw-r--r--src/wg_cookie.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/if_wg.c b/src/if_wg.c
index 73248a677f40..11b8394b9f7d 100644
--- a/src/if_wg.c
+++ b/src/if_wg.c
@@ -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();
diff --git a/src/wg_cookie.c b/src/wg_cookie.c
index 31bcf7835d79..d87bfe5d6d6d 100644
--- a/src/wg_cookie.c
+++ b/src/wg_cookie.c
@@ -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