bgpd: Fix stale EVPN type-5 route for suppressed prefix during L3VNI bounce - #21992
Conversation
β¦bounce bgp_evpn_advertise_type5_routes() does not check BGP_PATH_REMOVED flag when walking the VRF table. During interface flaps with concurrent L3VNI bounce, a route can be in a transient state where it is: - BGP_PATH_SELECTED (bgp_process() deferred, hasn't cleared it yet) - BGP_PATH_REMOVED (redistribute_delete marked it for deletion) - UNSUPPRESSED (bgp_aggregate_decrement removed it from aggregate) When L3VNI add triggers bgp_evpn_advertise_type5_routes(), such a route passes the SELECTED and injectable checks and gets advertised into EVPN as a type-5 route. Once the interface comes back up and the route gets re-suppressed by the aggregate, no subsequent withdraw or advertise walk will touch it (suppressed routes are skipped), leaving a stale type-5 permanently in the EVPN table. Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
Greptile SummaryThis one-line guard prevents stale EVPN type-5 routes during L3VNI bounce by skipping paths marked
Confidence Score: 5/5Safe to merge β the change is a minimal, targeted guard in a single function with no side effects on adjacent code paths. The fix is a two-line conditional inserted at exactly the right point in the advertise walk. It mirrors the BGP_PATH_REMOVED checks used throughout the rest of bgp_evpn.c and bgp_route.c, the companion withdraw function is unaffected, and the is_route_injectable_into_evpn() suppression check that precedes it is unchanged. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant IF as Interface
participant RD as redistribute_delete
participant ADV as bgp_evpn_advertise_type5_routes
IF->>RD: Interface flap sets BGP_PATH_REMOVED
Note over RD: BGP_PATH_SELECTED still set (bgp_process deferred)
RD->>ADV: L3VNI bounce triggers advertise walk
alt BEFORE fix
ADV->>ADV: SELECTED check passes, type-5 advertised (stale)
else AFTER fix
ADV->>ADV: REMOVED check skips route correctly
end
Reviews (1): Last reviewed commit: "bgpd: Fix stale EVPN type-5 route for su..." | Re-trigger Greptile |
|
NOTE:Β Β Everything below happens in ~35ms timeframe (So, a race condition or a timing issue) |
bgp_evpn_withdraw_type5_routes() skips suppressed routes because it uses is_route_injectable_into_evpn() which filters on suppression. If a route was advertised while unsuppressed then re-suppressed before the withdraw walk runs, its stale type-5 is never cleaned up. Fix is to use is_route_injectable_into_evpn_non_supp() instead, consistent with bgp_aggr_supp_withdraw_from_evpn() which already uses this variant. Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
|
ci failure is unrelated ... |
bgpd: Fix stale EVPN type-5 route for suppressed prefix during L3VNI bounce
bgpd: Withdraw type-5 routes regardless of aggregate suppression state
A topotest for this issue is not feasible since it requires a precise race condition within a ~35ms window that is near impossible to reproduce deterministically. It was hit once in internal testing and root-caused through LTTng trace analysis. Please refer #21992 (comment)