From 91b1421e845844d894d7cc162cc5d3244efbd206 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Tue, 8 Dec 2020 11:11:05 +0000 Subject: [PATCH] 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 --- zebra/zebra_vrf.c | 2 ++ 1 file changed, 2 insertions(+) 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); -- 2.39.5