]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: reset ipv6 invalid link-local nexthop
authorLouis Scalbert <louis.scalbert@6wind.com>
Wed, 9 Oct 2024 15:08:44 +0000 (17:08 +0200)
committerLouis Scalbert <louis.scalbert@6wind.com>
Thu, 10 Oct 2024 09:39:04 +0000 (11:39 +0200)
If the "nexthop-local unchanged" setting is enabled, it preserves the
IPv6 link-local nexthop from the originating peer. However, if the
originating and destination peers are not on the same network segment,
the originating peer's IPv6 link-local address will be unreachable from
the destination peer.

In such cases, reset the IPv6 link-local nexthop, even if "nexthop-local
unchanged" is set on the destination peer.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
bgpd/bgp_route.c

index b0f91b58b9c99f306dca897cffe5e4aa289a502f..9cefec0706ee694fa9c3cca27eb4480ea2fc807a 100644 (file)
@@ -2492,8 +2492,11 @@ bool subgroup_announce_check(struct bgp_dest *dest, struct bgp_path_info *pi,
                 * ensure more prefixes share the same attribute for
                 * announcement.
                 */
-               if (!(CHECK_FLAG(peer->af_flags[afi][safi],
-                                PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED)))
+               if (!(CHECK_FLAG(peer->af_flags[afi][safi], PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED)) ||
+                   !IPV6_ADDR_SAME(&peer->nexthop.v6_global, &from->nexthop.v6_global))
+                       /* Reset if "nexthop-local unchanged" is not set or originating and destination peer
+                        * does not share the same subnet.
+                        */
                        memset(&attr->mp_nexthop_local, 0, IPV6_MAX_BYTELEN);
        }