mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-29 15:07:51 +00:00
Merge pull request #10522 from FRRouting/mergify/bp/dev/8.2/pr-10441
pimd: Only remove bsr NHT if we actually have tracked something (backport #10441)
This commit is contained in:
commit
0f8011e47c
@ -557,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;
|
||||
@ -582,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;
|
||||
|
@ -259,6 +259,14 @@ void pim_nht_bsr_del(struct pim_instance *pim, struct in_addr addr)
|
||||
struct pim_nexthop_cache *pnc = NULL;
|
||||
struct pim_nexthop_cache lookup;
|
||||
|
||||
/*
|
||||
* Nothing to do here if the address to unregister
|
||||
* is 0.0.0.0 as that the BSR has not been registered
|
||||
* for tracking yet.
|
||||
*/
|
||||
if (addr.s_addr == INADDR_ANY)
|
||||
return;
|
||||
|
||||
lookup.rpf.rpf_addr.family = AF_INET;
|
||||
lookup.rpf.rpf_addr.prefixlen = IPV4_MAX_BITLEN;
|
||||
lookup.rpf.rpf_addr.u.prefix4 = addr;
|
||||
|
Loading…
Reference in New Issue
Block a user