Skip to content

Commit

Permalink
Merge pull request #17392 from opensourcerouting/fix/backport_17376_10.1
Browse files Browse the repository at this point in the history
bgpd: Clear stale routes with multiple paths (backport)
  • Loading branch information
donaldsharp authored Nov 8, 2024
2 parents 6b98c2a + a603771 commit 7f28c47
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 10 additions & 4 deletions bgpd/bgp_fsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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 {
Expand All @@ -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",
Expand All @@ -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;
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
}
}
}
Expand Down

0 comments on commit 7f28c47

Please sign in to comment.