pimd: Only remove bsr NHT if we actually have tracked something

I'm now seeing in my log file:

2022/01/28 11:20:05 PIM: [Q0PZ7-QBBN3] attempting to delete nonexistent NHT BSR entry 0.0.0.0
2022/01/28 11:20:05 PIM: [Q0PZ7-QBBN3] attempting to delete nonexistent NHT BSR entry 0.0.0.0
2022/01/28 11:20:06 PIM: [Q0PZ7-QBBN3] attempting to delete nonexistent NHT BSR entry 0.0.0.0

When I run pimd.  Looking at the code there are 3 places where pim_bsm.c removes the
NHT BSR tracking.  In 2 of them the code ensures that the address is already setup
in 1 place it is not.  Fix.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 2d51f27f02)
This commit is contained in:
Donald Sharp 2022-01-28 11:17:53 -05:00 committed by mergify-bot
parent f49dcb5783
commit 2711d7af9f

View File

@ -171,7 +171,8 @@ static int pim_on_bs_timer(struct thread *t)
zlog_debug("%s: Bootstrap Timer expired for scope: %d",
__func__, scope->sz_id);
pim_nht_bsr_del(scope->pim, scope->current_bsr);
if (scope->current_bsr.s_addr)
pim_nht_bsr_del(scope->pim, scope->current_bsr);
/* Reset scope zone data */
scope->accept_nofwd_bsm = false;