mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 20:19:53 +00:00
Merge pull request #17667 from opensourcerouting/fix/withdraw_routes_regarless_of_coalescing_timer_to_expire_path_info_unusable
bgpd: Withdraw routes without waiting for the coalescing timer to expire
This commit is contained in:
commit
1b13705517
@ -228,64 +228,67 @@ static int group_announce_route_walkcb(struct update_group *updgrp, void *arg)
|
|||||||
afi2str(afi), safi2str(safi), ctx->dest);
|
afi2str(afi), safi2str(safi), ctx->dest);
|
||||||
|
|
||||||
UPDGRP_FOREACH_SUBGRP (updgrp, subgrp) {
|
UPDGRP_FOREACH_SUBGRP (updgrp, subgrp) {
|
||||||
/* withdraw stale addpath without waiting for the coalesce timer timeout.
|
/* An update-group that uses addpath */
|
||||||
* Otherwise, since adj->addpath_tx_id is overwritten, the code never
|
if (addpath_capable) {
|
||||||
* notice anymore it has to do a withdrawal.
|
/* Send withdrawals without waiting for coalesting timer
|
||||||
*/
|
* to expire.
|
||||||
if (addpath_capable)
|
*/
|
||||||
subgrp_withdraw_stale_addpath(ctx, subgrp);
|
if (subgrp->t_coalesce) {
|
||||||
/*
|
subgrp_withdraw_stale_addpath(ctx, subgrp);
|
||||||
* Skip the subgroups that have coalesce timer running. We will
|
|
||||||
* walk the entire prefix table for those subgroups when the
|
|
||||||
* coalesce timer fires.
|
|
||||||
*/
|
|
||||||
if (!subgrp->t_coalesce) {
|
|
||||||
|
|
||||||
/* An update-group that uses addpath */
|
goto done;
|
||||||
if (addpath_capable) {
|
|
||||||
subgrp_announce_addpath_best_selected(ctx->dest,
|
|
||||||
subgrp);
|
|
||||||
|
|
||||||
/* Process the bestpath last so the "show [ip]
|
|
||||||
* bgp neighbor x.x.x.x advertised"
|
|
||||||
* output shows the attributes from the bestpath
|
|
||||||
*/
|
|
||||||
if (ctx->pi)
|
|
||||||
subgroup_process_announce_selected(
|
|
||||||
subgrp, ctx->pi, ctx->dest, afi,
|
|
||||||
safi,
|
|
||||||
bgp_addpath_id_for_peer(
|
|
||||||
peer, afi, safi,
|
|
||||||
&ctx->pi->tx_addpath));
|
|
||||||
}
|
}
|
||||||
/* An update-group that does not use addpath */
|
|
||||||
else {
|
subgrp_withdraw_stale_addpath(ctx, subgrp);
|
||||||
if (ctx->pi) {
|
subgrp_announce_addpath_best_selected(ctx->dest, subgrp);
|
||||||
subgroup_process_announce_selected(
|
|
||||||
subgrp, ctx->pi, ctx->dest, afi,
|
/* Process the bestpath last so the
|
||||||
safi,
|
* "show [ip] bgp neighbor x.x.x.x advertised" output shows
|
||||||
bgp_addpath_id_for_peer(
|
* the attributes from the bestpath.
|
||||||
peer, afi, safi,
|
*/
|
||||||
&ctx->pi->tx_addpath));
|
if (ctx->pi)
|
||||||
} else {
|
subgroup_process_announce_selected(
|
||||||
/* Find the addpath_tx_id of the path we
|
subgrp, ctx->pi, ctx->dest, afi, safi,
|
||||||
* had advertised and
|
bgp_addpath_id_for_peer(peer, afi, safi,
|
||||||
* send a withdraw */
|
&ctx->pi->tx_addpath));
|
||||||
RB_FOREACH_SAFE (adj, bgp_adj_out_rb,
|
} else {
|
||||||
&ctx->dest->adj_out,
|
/* Send withdrawals without waiting for coalesting timer
|
||||||
|
* to expire.
|
||||||
|
*/
|
||||||
|
if (subgrp->t_coalesce) {
|
||||||
|
if (!ctx->pi || CHECK_FLAG(ctx->pi->flags, BGP_PATH_UNUSEABLE)) {
|
||||||
|
RB_FOREACH_SAFE (adj, bgp_adj_out_rb, &ctx->dest->adj_out,
|
||||||
adj_next) {
|
adj_next) {
|
||||||
if (adj->subgroup == subgrp) {
|
if (adj->subgroup == subgrp) {
|
||||||
subgroup_process_announce_selected(
|
subgroup_process_announce_selected(
|
||||||
subgrp, NULL,
|
subgrp, NULL, ctx->dest, afi, safi,
|
||||||
ctx->dest, afi,
|
|
||||||
safi,
|
|
||||||
adj->addpath_tx_id);
|
adj->addpath_tx_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ctx->pi) {
|
||||||
|
subgroup_process_announce_selected(
|
||||||
|
subgrp, ctx->pi, ctx->dest, afi, safi,
|
||||||
|
bgp_addpath_id_for_peer(peer, afi, safi,
|
||||||
|
&ctx->pi->tx_addpath));
|
||||||
|
} else {
|
||||||
|
RB_FOREACH_SAFE (adj, bgp_adj_out_rb, &ctx->dest->adj_out,
|
||||||
|
adj_next) {
|
||||||
|
if (adj->subgroup == subgrp) {
|
||||||
|
subgroup_process_announce_selected(subgrp, NULL,
|
||||||
|
ctx->dest, afi,
|
||||||
|
safi,
|
||||||
|
adj->addpath_tx_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
done:
|
||||||
/* Notify BGP Conditional advertisement */
|
/* Notify BGP Conditional advertisement */
|
||||||
bgp_notify_conditional_adv_scanner(subgrp);
|
bgp_notify_conditional_adv_scanner(subgrp);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user