diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2022-02-04 08:49:39 -0500 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2022-02-04 10:55:11 -0500 | 
| commit | 5f010b1205a9b4977d08329bd3e100fb5f41c0ff (patch) | |
| tree | 7da679f4dfaaaf7caead1a1079156f18e20f416b /pimd/pim_nht.c | |
| parent | 2d51f27f028412ad089ff1f910f6489eb917631d (diff) | |
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_nht.c')
| -rw-r--r-- | pimd/pim_nht.c | 8 | 
1 files changed, 8 insertions, 0 deletions
diff --git a/pimd/pim_nht.c b/pimd/pim_nht.c index cd6f4c45fa..94a624e2c4 100644 --- a/pimd/pim_nht.c +++ b/pimd/pim_nht.c @@ -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;  | 
