From: Philippe Guibert Date: Mon, 11 Dec 2017 14:19:15 +0000 (+0100) Subject: zebra: route configuration fix for vrf when applied to namespaces X-Git-Tag: frr-5.0-dev~209^2~36 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=9a76375f39f556188d25920fb53802c091bc4064;p=mirror%2Ffrr.git zebra: route configuration fix for vrf when applied to namespaces 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 --- diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 20abd76973..84c7b8e9cf 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -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);