]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: don't use if_lookup_by_index_all_vrf
authorIgor Ryzhov <iryzhov@nfware.com>
Thu, 14 Oct 2021 16:11:15 +0000 (19:11 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Thu, 28 Oct 2021 15:54:46 +0000 (18:54 +0300)
if_lookup_by_index_all_vrf doesn't work correctly with netns VRF backend
as the same index may be used in multiple netns simultaneously.

In both case where it's used, we know the VRF in which we need to lookup
for the interface.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
zebra/zebra_l2.c
zebra/zebra_vxlan.c

index 5a02149611fbaf8e8d27694ae8f28b439ac0140e..36ec6566624d91bb4b50d2bcfb960e291b1b8eec 100644 (file)
@@ -162,7 +162,7 @@ void zebra_l2_map_slave_to_bond(struct zebra_if *zif, vrf_id_t vrf_id)
        struct zebra_if *bond_zif;
        struct zebra_l2info_bondslave *bond_slave = &zif->bondslave_info;
 
-       bond_if = if_lookup_by_index_all_vrf(bond_slave->bond_ifindex);
+       bond_if = if_lookup_by_index(bond_slave->bond_ifindex, vrf_id);
        if (bond_if == bond_slave->bond_if)
                return;
 
index c13c867d2a4a18879ef47341fe360e96c5edbf89..bb46a1e62e7f1ef416eeefb182459aaa5bc21a4a 100644 (file)
@@ -4736,13 +4736,11 @@ void zebra_vxlan_macvlan_down(struct interface *ifp)
        assert(zif);
        link_ifp = zif->link;
        if (!link_ifp) {
-               if (IS_ZEBRA_DEBUG_VXLAN) {
-                       struct interface *ifp;
-
-                       ifp = if_lookup_by_index_all_vrf(zif->link_ifindex);
-                       zlog_debug("macvlan parent link is not found. Parent index %d ifp %s",
-                               zif->link_ifindex, ifp ? ifp->name : " ");
-               }
+               if (IS_ZEBRA_DEBUG_VXLAN)
+                       zlog_debug(
+                               "macvlan parent link is not found. Parent index %d ifp %s",
+                               zif->link_ifindex,
+                               ifindex2ifname(zif->link_ifindex, ifp->vrf_id));
                return;
        }
        link_zif = link_ifp->info;