From 6225c5de8b3d83479a0422c0a45c2b0f314983c6 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Thu, 7 Nov 2024 13:04:54 +0200 Subject: [PATCH 1/2] bgpd: Clear all paths including addpath once GR expires We iterated over all bgp_path_info's, but once we remove the path, we didn't check for other paths under the same bgp_dest. Signed-off-by: Donatas Abraitis --- bgpd/bgp_route.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 18af484530ca..c62f3e00bb70 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -6214,7 +6214,6 @@ void bgp_clear_stale_route(struct peer *peer, afi_t afi, safi_t safi) vpn_leak_to_vrf_withdraw(pi); bgp_rib_remove(rm, pi, peer, afi, safi); - break; } } } else { @@ -6243,7 +6242,6 @@ void bgp_clear_stale_route(struct peer *peer, afi_t afi, safi_t safi) pi); bgp_rib_remove(dest, pi, peer, afi, safi); - break; } } } From a603771fd7c26cd1366824f06f6509f0615fcafb Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Thu, 7 Nov 2024 13:08:35 +0200 Subject: [PATCH 2/2] bgpd: Set LLGR stale routes for all the paths including addpath Without this patch we set only the first path for the route (if multiple exist) as LLGR stale and stop doing that for the rest of the paths, which is wrong. Fixes: 1479ed2fb35f4a5ae1017201a7ee37ba2727163a ("bgpd: Implement LLGR helper mode") Signed-off-by: Donatas Abraitis --- bgpd/bgp_fsm.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index d41ef8abbac9..cd2faa477790 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -687,6 +687,11 @@ static void bgp_set_llgr_stale(struct peer *peer, afi_t afi, safi_t safi) COMMUNITY_NO_LLGR)) continue; + if (bgp_attr_get_community(pi->attr) && + community_include(bgp_attr_get_community(pi->attr), + COMMUNITY_LLGR_STALE)) + continue; + if (bgp_debug_neighbor_events(peer)) zlog_debug( "%pBP Long-lived set stale community (LLGR_STALE) for: %pFX", @@ -697,8 +702,6 @@ static void bgp_set_llgr_stale(struct peer *peer, afi_t afi, safi_t safi) pi->attr = bgp_attr_intern(&attr); bgp_recalculate_afi_safi_bestpaths( peer->bgp, afi, safi); - - break; } } } else { @@ -715,6 +718,11 @@ static void bgp_set_llgr_stale(struct peer *peer, afi_t afi, safi_t safi) COMMUNITY_NO_LLGR)) continue; + if (bgp_attr_get_community(pi->attr) && + community_include(bgp_attr_get_community(pi->attr), + COMMUNITY_LLGR_STALE)) + continue; + if (bgp_debug_neighbor_events(peer)) zlog_debug( "%pBP Long-lived set stale community (LLGR_STALE) for: %pFX", @@ -725,8 +733,6 @@ static void bgp_set_llgr_stale(struct peer *peer, afi_t afi, safi_t safi) pi->attr = bgp_attr_intern(&attr); bgp_recalculate_afi_safi_bestpaths(peer->bgp, afi, safi); - - break; } } }