Skip to content

Commit

Permalink
Merge pull request #16830 from louis-6wind/fix-addpath-race
Browse files Browse the repository at this point in the history
bgpd: fix missing addpath withdrawal race condition
  • Loading branch information
riw777 authored Dec 17, 2024
2 parents 3bebb7b + f407abe commit 0d5a94d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bgpd/bgp_updgrp_adv.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,12 @@ static int group_announce_route_walkcb(struct update_group *updgrp, void *arg)
afi2str(afi), safi2str(safi), ctx->dest);

UPDGRP_FOREACH_SUBGRP (updgrp, subgrp) {
/* withdraw stale addpath without waiting for the coalesce timer timeout.
* Otherwise, since adj->addpath_tx_id is overwritten, the code never
* notice anymore it has to do a withdrawal.
*/
if (addpath_capable)
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
Expand All @@ -237,8 +243,6 @@ static int group_announce_route_walkcb(struct update_group *updgrp, void *arg)

/* An update-group that uses addpath */
if (addpath_capable) {
subgrp_withdraw_stale_addpath(ctx, subgrp);

subgrp_announce_addpath_best_selected(ctx->dest,
subgrp);

Expand Down

0 comments on commit 0d5a94d

Please sign in to comment.