summaryrefslogtreecommitdiffstats
path: root/lib/netns_linux.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 04:24:32 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 04:24:32 +0000
commit35cadacd2bb9383686753731e31bd7e145fb2506 (patch)
tree4489adbde75a837989533837185b2b8369a0bf68 /lib/netns_linux.c
parentAdding debian version 9.1-0.1. (diff)
downloadfrr-35cadacd2bb9383686753731e31bd7e145fb2506.tar.xz
frr-35cadacd2bb9383686753731e31bd7e145fb2506.zip
Merging upstream version 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)