]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: anticipate zns creation at vrf creation when backend is vrf-lite 7715/head
authorPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 8 Dec 2020 11:11:05 +0000 (11:11 +0000)
committerIgor Ryzhov <iryzhov@nfware.com>
Fri, 11 Dec 2020 08:26:24 +0000 (11:26 +0300)
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>
zebra/zebra_vrf.c

index b7cbf5262a832e3e1125a78dfccb1ce0a1b992b3..be4fb29aae88d208dfe84c2fabe1c42628cbd801 100644 (file)
@@ -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);