summaryrefslogtreecommitdiffstats
path: root/pimd/pim_rpf.c
diff options
context:
space:
mode:
authorsarita patra <saritap@vmware.com>2022-02-25 14:17:08 +0100
committersarita patra <saritap@vmware.com>2022-03-01 18:45:56 +0100
commitcc144e8b6b11e7e44f34871dd24b1ab21107b4b8 (patch)
treecc3c985c57a6ff7393d38c422e5ebc6e556f1ac6 /pimd/pim_rpf.c
parentMerge pull request #10615 from mobash-rasool/fixes (diff)
downloadfrr-cc144e8b6b11e7e44f34871dd24b1ab21107b4b8.tar.xz
frr-cc144e8b6b11e7e44f34871dd24b1ab21107b4b8.zip
pimd: replace inaddr_none with PIMADDR_ANY
We can use PIMADDR_ANY instead of INADDR_NONE to initalize rp->rpf_addr when there is no rp configured for group_all. Signed-off-by: sarita patra <saritap@vmware.com>
Diffstat (limited to 'pimd/pim_rpf.c')
-rw-r--r--pimd/pim_rpf.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/pimd/pim_rpf.c b/pimd/pim_rpf.c
index 2e8fc8e66..2741b5bf4 100644
--- a/pimd/pim_rpf.c
+++ b/pimd/pim_rpf.c
@@ -51,7 +51,7 @@ void pim_rpf_set_refresh_time(struct pim_instance *pim)
}
bool pim_nexthop_lookup(struct pim_instance *pim, struct pim_nexthop *nexthop,
- struct in_addr addr, int neighbor_needed)
+ pim_addr addr, int neighbor_needed)
{
struct pim_zlookup_nexthop nexthop_tab[MULTIPATH_NUM];
struct pim_neighbor *nbr = NULL;
@@ -66,7 +66,7 @@ bool pim_nexthop_lookup(struct pim_instance *pim, struct pim_nexthop *nexthop,
* 255.255.255.255 address, since
* it will never work
*/
- if (addr.s_addr == INADDR_NONE)
+ if (pim_addr_is_any(addr))
return false;
if ((nexthop->last_lookup.s_addr == addr.s_addr)
@@ -405,19 +405,6 @@ static struct in_addr pim_rpf_find_rpf_addr(struct pim_upstream *up)
return rpf_addr;
}
-int pim_rpf_addr_is_inaddr_none(struct pim_rpf *rpf)
-{
- switch (rpf->rpf_addr.family) {
- case AF_INET:
- return rpf->rpf_addr.u.prefix4.s_addr == INADDR_NONE;
- case AF_INET6:
- zlog_warn("%s: v6 Unimplmeneted", __func__);
- return 1;
- default:
- return 0;
- }
-}
-
int pim_rpf_addr_is_inaddr_any(struct pim_rpf *rpf)
{
switch (rpf->rpf_addr.family) {