]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: anticipate zns creation at vrf creation when backend is vrf-lite
authorPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 8 Dec 2020 11:11:05 +0000 (11:11 +0000)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Wed, 9 Dec 2020 13:26:20 +0000 (13:26 +0000)
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);