Skip to content

Commit 5bb99cc

Browse files
committed
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 <[email protected]>
1 parent 34c1dd0 commit 5bb99cc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

bgpd/bgp_route.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -2492,8 +2492,11 @@ bool subgroup_announce_check(struct bgp_dest *dest, struct bgp_path_info *pi,
24922492
* ensure more prefixes share the same attribute for
24932493
* announcement.
24942494
*/
2495-
if (!(CHECK_FLAG(peer->af_flags[afi][safi],
2496-
PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED)))
2495+
if (!(CHECK_FLAG(peer->af_flags[afi][safi], PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED)) ||
2496+
!IPV6_ADDR_SAME(&peer->nexthop.v6_global, &from->nexthop.v6_global))
2497+
/* Reset if "nexthop-local unchanged" is not set or originating and destination peer
2498+
* does not share the same subnet.
2499+
*/
24972500
memset(&attr->mp_nexthop_local, 0, IPV6_MAX_BYTELEN);
24982501
}
24992502

0 commit comments

Comments
 (0)