Skip to content

Commit

Permalink
bgpd: Exclude case for remote prefix w/o link-local
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
cunningr committed Aug 29, 2024
1 parent 77e1a26 commit 5f6a61f
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5f6a61f

Please sign in to comment.