From 35cadacd2bb9383686753731e31bd7e145fb2506 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 06:24:32 +0200 Subject: Merging upstream version 10.0. Signed-off-by: Daniel Baumann --- lib/netns_linux.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/netns_linux.c') diff --git a/lib/netns_linux.c b/lib/netns_linux.c index 297e2c5..8fa4bc6 100644 --- a/lib/netns_linux.c +++ b/lib/netns_linux.c @@ -5,6 +5,7 @@ */ #include +#include #ifdef HAVE_NETNS #undef _GNU_SOURCE @@ -502,12 +503,19 @@ void ns_init_management(ns_id_t default_ns_id, ns_id_t internal_ns) void ns_terminate(void) { struct ns *ns; + struct ns_map_nsid *ns_map; while (!RB_EMPTY(ns_head, &ns_tree)) { ns = RB_ROOT(ns_head, &ns_tree); ns_delete(ns); } + + while (!RB_EMPTY(ns_map_nsid_head, &ns_map_nsid_list)) { + ns_map = RB_ROOT(ns_map_nsid_head, &ns_map_nsid_list); + RB_REMOVE(ns_map_nsid_head, &ns_map_nsid_list, ns_map); + XFREE(MTYPE_NS, ns_map); + } } int ns_switch_to_netns(const char *name) -- cgit v1.2.3