]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: route configuration fix for vrf when applied to namespaces
authorPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 11 Dec 2017 14:19:15 +0000 (15:19 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 27 Feb 2018 10:11:24 +0000 (11:11 +0100)
For each route to be added or deleted, instead of applying directly to
default namespaces, when a vrf is mapped to a namespace, then the
correct zns must be found out.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
zebra/rt_netlink.c

index 20abd7697374b66ad4d6e53a8364f2148982f5c9..84c7b8e9cfa2f1ef28e75a468431f02d06fa9faf 100644 (file)
@@ -1334,9 +1334,13 @@ static int netlink_route_multipath(int cmd, struct prefix *p,
                char buf[NL_PKT_BUF_SIZE];
        } req;
 
-       struct zebra_ns *zns = zebra_ns_lookup(NS_DEFAULT);
+       struct zebra_ns *zns;
        struct zebra_vrf *zvrf = vrf_info_lookup(re->vrf_id);
 
+       if (!vrf_is_backend_netns())
+               zns = zebra_ns_lookup(NS_DEFAULT);
+       else
+               zns = (struct zebra_ns *)ns_info_lookup(re->vrf_id);
        memset(&req, 0, sizeof req - NL_PKT_BUF_SIZE);
 
        bytelen = (family == AF_INET ? 4 : 16);