]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: fix misc changes related to link updates with correct zns
authorPhilippe Guibert <philippe.guibert@6wind.com>
Thu, 22 Mar 2018 16:00:48 +0000 (17:00 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 23 Mar 2018 08:04:33 +0000 (09:04 +0100)
Because vrf with netns backend may be used, the correct zns must be
found prior any modifications.

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

index 01283f9122d89dd6cb197a76ef39bacf2bedd970..7795d34d0b7e38a06b0364f973644c8d2265014e 100644 (file)
@@ -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);