diff options
Diffstat (limited to 'zebra/zebra_netns_notify.c')
| -rw-r--r-- | zebra/zebra_netns_notify.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/zebra/zebra_netns_notify.c b/zebra/zebra_netns_notify.c index 4e504c48b0..ec7681bf23 100644 --- a/zebra/zebra_netns_notify.c +++ b/zebra/zebra_netns_notify.c @@ -72,14 +72,13 @@ static void zebra_ns_notify_create_context_from_entry_name(const char *name) char *netnspath = ns_netns_pathname(NULL, name); struct vrf *vrf; int ret; - ns_id_t ns_id, ns_id_external, ns_id_relative = NS_UNKNOWN; - struct ns *default_ns; + ns_id_t ns_id, ns_id_external; if (netnspath == NULL) return; frr_with_privs(&zserv_privs) { - ns_id = zebra_ns_id_get(netnspath, -1); + ns_id = zebra_ns_id_get(netnspath); } if (ns_id == NS_UNKNOWN) return; @@ -98,21 +97,9 @@ static void zebra_ns_notify_create_context_from_entry_name(const char *name) ns_map_nsid_with_external(ns_id, false); return; } - - default_ns = ns_get_default(); - - /* force kernel ns_id creation in that new vrf */ - frr_with_privs(&zserv_privs) { - ns_switch_to_netns(netnspath); - ns_id_relative = zebra_ns_id_get(NULL, default_ns->fd); - ns_switchback_to_initial(); - } - frr_with_privs(&zserv_privs) { ret = vrf_netns_handler_create(NULL, vrf, netnspath, - ns_id_external, - ns_id, - ns_id_relative); + ns_id_external, ns_id); } if (ret != CMD_SUCCESS) { flog_warn(EC_ZEBRA_NS_VRF_CREATION_FAILED, @@ -185,7 +172,7 @@ static bool zebra_ns_notify_is_default_netns(const char *name) { struct stat default_netns_stat; struct stat st; - char netnspath[64]; + char netnspath[PATH_MAX]; if (zebra_ns_notify_self_identify(&default_netns_stat)) return false; |
