diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2018-01-22 09:42:53 +0100 |
|---|---|---|
| committer | Philippe Guibert <philippe.guibert@6wind.com> | 2018-02-27 11:10:41 +0100 |
| commit | 78dd30b263948ffb1d5c22592ef2d70b331bf071 (patch) | |
| tree | ef8f2a8f59daed17b0f7453d0aac6241f3f41e0d /lib/ns.c | |
| parent | ac3133a35d340a765be1518c2669b979e39fbe66 (diff) | |
zebra: add a runtime flag to enable vrf with netns
The netns backend is chosen by VRF if a runtime flag named vrfwnetns is
selected when running zebra.
In the case the NETNS backend is chosen, in some case the VRFID value is
being assigned the value of the NSID. Within the perimeter of that work,
this is why the vrf_lookup_by_table function is extended with a new
parameter.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'lib/ns.c')
| -rw-r--r-- | lib/ns.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -378,7 +378,9 @@ static int ns_config_write(struct vty *vty) struct ns *ns; int write = 0; - RB_FOREACH (ns, ns_head, &ns_tree) { + if (vrf_is_backend_netns()) + return 0; + RB_FOREACH(ns, ns_head, &ns_tree) { if (ns->ns_id == NS_DEFAULT || ns->name == NULL) continue; @@ -411,7 +413,7 @@ void ns_init(void) exit(1); } - if (have_netns()) { + if (have_netns() && !vrf_is_backend_netns()) { /* Install NS commands. */ install_node(&ns_node, ns_config_write); install_element(CONFIG_NODE, &ns_netns_cmd); |
