Skip to content

Commit

Permalink
pimd: fix BSR RPs timing out
Browse files Browse the repository at this point in the history
On the BSR node itself, RPs shouldn't timeout, becase we know
the node is the BSR, and it is active!

fixes:#17587

Signed-off-by: Jafar Al-Gharaibeh <[email protected]>
  • Loading branch information
Jafaral committed Jan 13, 2025
1 parent a962ff7 commit c30a3ad
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions pimd/pim_bsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,24 +354,29 @@ static void pim_on_g2rp_timer(struct event *t)
bsrp = EVENT_ARG(t);
EVENT_OFF(bsrp->g2rp_timer);
bsgrp_node = bsrp->bsgrp_node;

/* elapse time is the hold time of expired node */
elapse = bsrp->rp_holdtime;
pim = bsgrp_node->scope->pim;
bsrp_addr = bsrp->rp_address;

/* update elapse for all bsrp nodes */
frr_each_safe (bsm_rpinfos, bsgrp_node->bsrp_list, bsrp_node) {
bsrp_node->elapse_time += elapse;

if (is_hold_time_elapsed(bsrp_node)) {
bsm_rpinfos_del(bsgrp_node->bsrp_list, bsrp_node);
pim_bsm_rpinfo_free(bsrp_node);
/*
* Update elapse for all bsrp nodes except on the BSR itself.
* The timer is meant to remove any bsr RPs learned from the BSR that
* we don't hear from anymore. on the BSR itself, no need to do this.
*/
if (pim->global_scope.state != BSR_ELECTED) {
/* elapse time is the hold time of expired node */
elapse = bsrp->rp_holdtime;
frr_each_safe (bsm_rpinfos, bsgrp_node->bsrp_list, bsrp_node) {
bsrp_node->elapse_time += elapse;

if (is_hold_time_elapsed(bsrp_node)) {
bsm_rpinfos_del(bsgrp_node->bsrp_list, bsrp_node);
pim_bsm_rpinfo_free(bsrp_node);
}
}
}

/* Get the next elected rp node */
bsrp = bsm_rpinfos_first(bsgrp_node->bsrp_list);
pim = bsgrp_node->scope->pim;
rn = route_node_lookup(pim->rp_table, &bsgrp_node->group);

if (!rn) {
Expand Down

0 comments on commit c30a3ad

Please sign in to comment.