diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2019-10-02 13:34:40 +0200 | 
|---|---|---|
| committer | Anuradha Karuppiah <anuradhak@cumulusnetworks.com> | 2020-08-18 09:25:06 -0700 | 
| commit | 20f4b2b0719e68e1f78d8e1a8f73d5f3c2de2418 (patch) | |
| tree | ac558dd1e8350b28bfceb74f6d7f1fac3b9ef840 /zebra/zebra_ns.c | |
| parent | 2d4e4d39b776c0a389712be6cbb0b28cf7aa33ad (diff) | |
zebra, lib: store relative default ns id in each namespace
to be able to retrieve the network namespace identifier for each
namespace, the ns id is stored in each ns context. For default
namespace, the netns id is the same as that value.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'zebra/zebra_ns.c')
| -rw-r--r-- | zebra/zebra_ns.c | 4 | 
1 files changed, 4 insertions, 0 deletions
diff --git a/zebra/zebra_ns.c b/zebra/zebra_ns.c index 4e23ca2f03..13864cd429 100644 --- a/zebra/zebra_ns.c +++ b/zebra/zebra_ns.c @@ -183,12 +183,16 @@ int zebra_ns_init(const char *optional_default_name)  	struct ns *default_ns;  	ns_id_t ns_id;  	ns_id_t ns_id_external; +	struct ns *ns;  	frr_with_privs(&zserv_privs) {  		ns_id = zebra_ns_id_get_default();  	}  	ns_id_external = ns_map_nsid_with_external(ns_id, true);  	ns_init_management(ns_id_external, ns_id); +	ns = ns_get_default(); +	if (ns) +		ns->relative_default_ns = ns_id;  	default_ns = ns_lookup(ns_get_default_id());  	if (!default_ns) {  | 
