diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2023-12-11 15:44:26 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2023-12-11 15:44:26 -0500 |
| commit | 3d1f0c467b3d8cd9c7cb0fd3ea81165748ee8af0 (patch) | |
| tree | 5af5b1cac9c49fbfc40386f63143a73916e37dbd /lib/netns_linux.c | |
| parent | f77095430d9d2e58ff21006c0d1aaf820d54f041 (diff) | |
zebra: On shutdown properly free up ns memory
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'lib/netns_linux.c')
| -rw-r--r-- | lib/netns_linux.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/netns_linux.c b/lib/netns_linux.c index 297e2c5952..bebb5c1f77 100644 --- a/lib/netns_linux.c +++ b/lib/netns_linux.c @@ -502,12 +502,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) |
