summaryrefslogtreecommitdiffstats
path: root/lib/netns_linux.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 04:24:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 04:24:31 +0000
commitacb594b1d825c6e12369cebb941968ec08c840ce (patch)
treed544788908e7353a4f117e2991f15f4236a0c963 /lib/netns_linux.c
parentAdding upstream version 9.1. (diff)
downloadfrr-acb594b1d825c6e12369cebb941968ec08c840ce.tar.xz
frr-acb594b1d825c6e12369cebb941968ec08c840ce.zip
Adding upstream version 10.0.upstream/10.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/netns_linux.c')
-rw-r--r--lib/netns_linux.c8
1 files changed, 8 insertions, 0 deletions
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 <zebra.h>
+#include <fcntl.h>
#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)