From: Louis Scalbert Date: Wed, 9 Oct 2024 15:08:44 +0000 (+0200) Subject: bgpd: reset ipv6 invalid link-local nexthop X-Git-Tag: base_10.3~363^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=5bb99ccad2935adb006f7f727c2779b2c6e746e5;p=mirror%2Ffrr.git bgpd: reset ipv6 invalid link-local nexthop 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 --- diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index b0f91b58b9..9cefec0706 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -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); }