bgpd: Exclude case for remote prefix w/o link-local

If we expand the truth (A || B) to "(A && B) || (A && !B) || (!A && B)"
so that we can isolate the case (!A && B), we then add the additional
check (C) to ensure that original route actually has a link-local hext-hop

Signed-off-by: Richard Cunningham <29760295+cunningr@users.noreply.github.com>
This commit is contained in:
Richard Cunningham 2024-06-12 15:34:15 +01:00 committed by Richard Cunningham
parent 77e1a26faa
commit 5f6a61f91f

View File

@ -2472,13 +2472,16 @@ bool subgroup_announce_check(struct bgp_dest *dest, struct bgp_path_info *pi,
if (NEXTHOP_IS_V6) { if (NEXTHOP_IS_V6) {
attr->mp_nexthop_len = BGP_ATTR_NHLEN_IPV6_GLOBAL; attr->mp_nexthop_len = BGP_ATTR_NHLEN_IPV6_GLOBAL;
if ((CHECK_FLAG(peer->af_flags[afi][safi], if ((CHECK_FLAG(peer->af_flags[afi][safi],
PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED) PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED) &&
&& IN6_IS_ADDR_LINKLOCAL(&attr->mp_nexthop_local)) IN6_IS_ADDR_LINKLOCAL(&attr->mp_nexthop_local)) ||
|| (!reflect && !transparent (!reflect && !transparent &&
&& IN6_IS_ADDR_LINKLOCAL(&peer->nexthop.v6_local) IN6_IS_ADDR_LINKLOCAL(&peer->nexthop.v6_local) &&
&& peer->shared_network peer->shared_network &&
&& (from == bgp->peer_self ((from == bgp->peer_self && peer->sort == BGP_PEER_EBGP) ||
|| peer->sort == BGP_PEER_EBGP))) { (from == bgp->peer_self && peer->sort != BGP_PEER_EBGP) ||
(from != bgp->peer_self &&
IN6_IS_ADDR_LINKLOCAL(&attr->mp_nexthop_local) &&
peer->sort == BGP_PEER_EBGP)))) {
if (safi == SAFI_MPLS_VPN) if (safi == SAFI_MPLS_VPN)
attr->mp_nexthop_len = attr->mp_nexthop_len =
BGP_ATTR_NHLEN_VPNV6_GLOBAL_AND_LL; BGP_ATTR_NHLEN_VPNV6_GLOBAL_AND_LL;