From: Philippe Guibert Date: Thu, 22 Mar 2018 16:00:48 +0000 (+0100) Subject: zebra: fix misc changes related to link updates with correct zns X-Git-Tag: frr-5.0-dev~120^2~3 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=154a3944e806936c766052d44e85921be6f3c5d5;p=matthieu%2Ffrr.git zebra: fix misc changes related to link updates with correct zns Because vrf with netns backend may be used, the correct zns must be found prior any modifications. Signed-off-by: Philippe Guibert --- diff --git a/zebra/interface.c b/zebra/interface.c index 01283f9122..7795d34d0b 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -867,6 +867,7 @@ void if_up(struct interface *ifp) { struct zebra_if *zif; struct interface *link_if; + struct zebra_vrf *zvrf = vrf_info_lookup(ifp->vrf_id); zif = ifp->info; zif->up_count++; @@ -909,7 +910,7 @@ void if_up(struct interface *ifp) link_if = ifp; zebra_vxlan_svi_up(ifp, link_if); } else if (IS_ZEBRA_IF_VLAN(ifp)) { - link_if = if_lookup_by_index_per_ns(zebra_ns_lookup(NS_DEFAULT), + link_if = if_lookup_by_index_per_ns(zvrf->zns, zif->link_ifindex); if (link_if) zebra_vxlan_svi_up(ifp, link_if); @@ -922,6 +923,7 @@ void if_down(struct interface *ifp) { struct zebra_if *zif; struct interface *link_if; + struct zebra_vrf *zvrf = vrf_info_lookup(ifp->vrf_id); zif = ifp->info; zif->down_count++; @@ -938,7 +940,7 @@ void if_down(struct interface *ifp) link_if = ifp; zebra_vxlan_svi_down(ifp, link_if); } else if (IS_ZEBRA_IF_VLAN(ifp)) { - link_if = if_lookup_by_index_per_ns(zebra_ns_lookup(NS_DEFAULT), + link_if = if_lookup_by_index_per_ns(zvrf->zns, zif->link_ifindex); if (link_if) zebra_vxlan_svi_down(ifp, link_if);