summaryrefslogtreecommitdiff
path: root/lib/ns.c
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2017-12-07 15:58:48 +0100
committerPhilippe Guibert <philippe.guibert@6wind.com>2018-02-27 11:11:24 +0100
commit81c9005ff6edd2294ec945b93d49f03470b3b827 (patch)
tree8a213a60d1710b25dd611383cf8658702a41f793 /lib/ns.c
parentff705b15dd5e191e727662412a8433d718887a08 (diff)
zebra: enhance show vrf for netns and fixing
Show vrf command displays information on the vrf, if it is related to vrf kernel or if it is related to netns. When a vrf from kernel is detected, before creating a new vrf, a check is done against an already present vrf, and if that vrf is not a vrf mapped with a netns. If that is that case, then the creation is rejected. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'lib/ns.c')
-rw-r--r--lib/ns.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/ns.c b/lib/ns.c
index 5e6bddf0d8..5af896632c 100644
--- a/lib/ns.c
+++ b/lib/ns.c
@@ -218,6 +218,13 @@ void ns_walk_func(int (*func)(struct ns *))
func(ns);
}
+const char *ns_get_name(struct ns *ns)
+{
+ if (!ns)
+ return NULL;
+ return ns->name;
+}
+
/* Look up a NS by name */
static struct ns *ns_lookup_name(const char *name)
{