]> git.puffer.fish Git - matthieu/frr.git/commitdiff
Revert "bgpd: optimize bgp_interface_address_add"
authorDonatas Abraitis <donatas@opensourcerouting.org>
Wed, 14 Aug 2024 17:14:20 +0000 (20:14 +0300)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Wed, 14 Aug 2024 17:14:20 +0000 (20:14 +0300)
This reverts commit 8599fe2b5e34b2ac1a46a14983ddcc2336e9116d.

bgpd/bgp_zebra.c

index 79bb43bda9418997d2cfff996dfd54fb5d38689f..00013b1e7af11d2fc8cf3df1c8eb37649a77c05b 100644 (file)
@@ -335,11 +335,13 @@ static int bgp_interface_address_add(ZAPI_CALLBACK_ARGS)
                if (IN6_IS_ADDR_LINKLOCAL(&ifc->address->u.prefix6)
                    && !list_isempty(ifc->ifp->nbr_connected))
                        bgp_start_interface_nbrs(bgp, ifc->ifp);
-               else if (ifc->address->family == AF_INET6 &&
-                        !IN6_IS_ADDR_LINKLOCAL(&ifc->address->u.prefix6)) {
+               else {
                        addr = ifc->address;
 
                        for (ALL_LIST_ELEMENTS(bgp->peer, node, nnode, peer)) {
+                               if (addr->family == AF_INET)
+                                       continue;
+
                                /*
                                 * If the Peer's interface name matches the
                                 * interface name for which BGP received the
@@ -353,6 +355,7 @@ static int bgp_interface_address_add(ZAPI_CALLBACK_ARGS)
                                if ((peer->conf_if &&
                                     (strcmp(peer->conf_if, ifc->ifp->name) ==
                                      0)) &&
+                                   !IN6_IS_ADDR_LINKLOCAL(&addr->u.prefix6) &&
                                    ((IS_MAPPED_IPV6(
                                             &peer->nexthop.v6_global)) ||
                                     IN6_IS_ADDR_LINKLOCAL(