diff options
| author | Richard Cunningham <29760295+cunningr@users.noreply.github.com> | 2024-06-12 15:34:15 +0100 |
|---|---|---|
| committer | Richard Cunningham <cunningr@gmail.com> | 2024-08-29 20:59:14 +0100 |
| commit | 5f6a61f91fdbfa33df1b7112c961135156fbd894 (patch) | |
| tree | cb801bbf34deb109f7ad288ddb0a886baae47dfa | |
| parent | 77e1a26faa3c153abf6a8abb858f435914b62625 (diff) | |
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>
| -rw-r--r-- | bgpd/bgp_route.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 3ff7dbc070..7cc51331a5 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -2472,13 +2472,16 @@ bool subgroup_announce_check(struct bgp_dest *dest, struct bgp_path_info *pi, if (NEXTHOP_IS_V6) { attr->mp_nexthop_len = BGP_ATTR_NHLEN_IPV6_GLOBAL; if ((CHECK_FLAG(peer->af_flags[afi][safi], - PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED) - && IN6_IS_ADDR_LINKLOCAL(&attr->mp_nexthop_local)) - || (!reflect && !transparent - && IN6_IS_ADDR_LINKLOCAL(&peer->nexthop.v6_local) - && peer->shared_network - && (from == bgp->peer_self - || peer->sort == BGP_PEER_EBGP))) { + PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED) && + IN6_IS_ADDR_LINKLOCAL(&attr->mp_nexthop_local)) || + (!reflect && !transparent && + IN6_IS_ADDR_LINKLOCAL(&peer->nexthop.v6_local) && + peer->shared_network && + ((from == bgp->peer_self && 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) attr->mp_nexthop_len = BGP_ATTR_NHLEN_VPNV6_GLOBAL_AND_LL; |
