summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2020-12-08 11:11:05 +0000
committerPhilippe Guibert <philippe.guibert@6wind.com>2020-12-09 13:26:20 +0000
commit91b1421e845844d894d7cc162cc5d3244efbd206 (patch)
tree8b209a6f1c5c79f852a16692c7df7726fe6adcc0
parentd5ecf80558c023878f1b2a4ab76e59042f8cbb10 (diff)
zebra: anticipate zns creation at vrf creation when backend is vrf-lite
in the case the namespace pointer is already available, feed it at vrf creation. this prevents from crashing if the netlink parsing already began, and the vrf-lite is not enabled yet. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
-rw-r--r--zebra/zebra_vrf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/zebra/zebra_vrf.c b/zebra/zebra_vrf.c
index b7cbf5262a..be4fb29aae 100644
--- a/zebra/zebra_vrf.c
+++ b/zebra/zebra_vrf.c
@@ -107,6 +107,8 @@ static int zebra_vrf_new(struct vrf *vrf)
zvrf = zebra_vrf_alloc();
vrf->info = zvrf;
zvrf->vrf = vrf;
+ if (!vrf_is_backend_netns())
+ zvrf->zns = zebra_ns_lookup(NS_DEFAULT);
otable_init(&zvrf->other_tables);