]> git.puffer.fish Git - matthieu/frr.git/commitdiff
Revert "bgpd: fix removing ipv6 global nexhop"
authorDonatas Abraitis <donatas@opensourcerouting.org>
Wed, 14 Aug 2024 17:15:18 +0000 (20:15 +0300)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Wed, 14 Aug 2024 17:15:18 +0000 (20:15 +0300)
This reverts commit ee0378cdbb458f9d3710f1fb557368ace8d72477.

bgpd/bgp_zebra.c

index 00013b1e7af11d2fc8cf3df1c8eb37649a77c05b..d4a0209ea2f0edc1744ba0892ca70b247fa4ea49 100644 (file)
@@ -385,12 +385,10 @@ static int bgp_interface_address_add(ZAPI_CALLBACK_ARGS)
 static int bgp_interface_address_delete(ZAPI_CALLBACK_ARGS)
 {
        struct listnode *node, *nnode;
-       struct connected *ifc, *connected;
+       struct connected *ifc;
        struct peer *peer;
        struct bgp *bgp;
        struct prefix *addr;
-       struct in6_addr *v6_global = NULL;
-       struct in6_addr *v6_local = NULL;
        afi_t afi;
        safi_t safi;
 
@@ -412,17 +410,7 @@ static int bgp_interface_address_delete(ZAPI_CALLBACK_ARGS)
        addr = ifc->address;
 
        if (bgp && addr->family == AF_INET6 &&
-           !IN6_IS_ADDR_LINKLOCAL(&addr->u.prefix6)) {
-               /* find another IPv6 global if possible and find the IPv6 link-local */
-               frr_each (if_connected, ifc->ifp->connected, connected) {
-                       if (connected->address->family != AF_INET6)
-                               continue;
-                       if (IN6_IS_ADDR_LINKLOCAL(&connected->address->u.prefix6))
-                               v6_local = &connected->address->u.prefix6;
-                       else
-                               v6_global = &connected->address->u.prefix6;
-               }
-
+           !IN6_IS_ADDR_LINKLOCAL(&addr->u.prefix)) {
                /*
                 * When we are using the v6 global as part of the peering
                 * nexthops and we are removing it, then we need to
@@ -433,15 +421,8 @@ static int bgp_interface_address_delete(ZAPI_CALLBACK_ARGS)
                for (ALL_LIST_ELEMENTS(bgp->peer, node, nnode, peer)) {
                        if (IPV6_ADDR_SAME(&peer->nexthop.v6_global,
                                           &addr->u.prefix6)) {
-                               if (v6_global)
-                                       IPV6_ADDR_COPY(&peer->nexthop.v6_global,
-                                                      v6_global);
-                               else if (v6_local)
-                                       IPV6_ADDR_COPY(&peer->nexthop.v6_global,
-                                                      v6_local);
-                               else
-                                       memset(&peer->nexthop.v6_global, 0,
-                                              IPV6_MAX_BYTELEN);
+                               memset(&peer->nexthop.v6_global, 0,
+                                      IPV6_MAX_BYTELEN);
                                FOREACH_AFI_SAFI (afi, safi)
                                        bgp_announce_route(peer, afi, safi,
                                                           true);