diff options
author | Donald Sharp <sharpd@nvidia.com> | 2022-02-04 14:49:39 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2022-02-04 16:55:11 +0100 |
commit | 5f010b1205a9b4977d08329bd3e100fb5f41c0ff (patch) | |
tree | 7da679f4dfaaaf7caead1a1079156f18e20f416b /pimd/pim_bsm.c | |
parent | pimd: Only remove bsr NHT if we actually have tracked something (diff) | |
download | frr-5f010b1205a9b4977d08329bd3e100fb5f41c0ff.tar.xz frr-5f010b1205a9b4977d08329bd3e100fb5f41c0ff.zip |
pim: Use INADDR_ANY for current_bsr checking is valid yet
In all places that pim_nht_bsr_del is called, the code
needs to not unregister if the current_bsr is INADDR_ANY.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'pimd/pim_bsm.c')
-rw-r--r-- | pimd/pim_bsm.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/pimd/pim_bsm.c b/pimd/pim_bsm.c index cd50cdd67..c8b6d4e40 100644 --- a/pimd/pim_bsm.c +++ b/pimd/pim_bsm.c @@ -171,8 +171,7 @@ static int pim_on_bs_timer(struct thread *t) zlog_debug("%s: Bootstrap Timer expired for scope: %d", __func__, scope->sz_id); - if (scope->current_bsr.s_addr) - pim_nht_bsr_del(scope->pim, scope->current_bsr); + pim_nht_bsr_del(scope->pim, scope->current_bsr); /* Reset scope zone data */ scope->accept_nofwd_bsm = false; @@ -558,8 +557,7 @@ static void pim_bsm_update(struct pim_instance *pim, struct in_addr bsr, uint32_t bsr_prio) { if (bsr.s_addr != pim->global_scope.current_bsr.s_addr) { - if (pim->global_scope.current_bsr.s_addr) - pim_nht_bsr_del(pim, pim->global_scope.current_bsr); + pim_nht_bsr_del(pim, pim->global_scope.current_bsr); pim_nht_bsr_add(pim, bsr); pim->global_scope.current_bsr = bsr; @@ -583,8 +581,7 @@ void pim_bsm_clear(struct pim_instance *pim) struct rp_info *rp_info; bool upstream_updated = false; - if (pim->global_scope.current_bsr.s_addr) - pim_nht_bsr_del(pim, pim->global_scope.current_bsr); + pim_nht_bsr_del(pim, pim->global_scope.current_bsr); /* Reset scope zone data */ pim->global_scope.accept_nofwd_bsm = false; |