pimd: Add the ability to test if the RPF' is the same

Test the ability to see if two RPF' are the same
or not.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2016-11-02 10:53:28 -04:00
parent 0afd31c92b
commit 66cc32fa0a
2 changed files with 10 additions and 0 deletions

View File

@ -347,3 +347,12 @@ pim_rpf_addr_is_inaddr_any (struct pim_rpf *rpf)
return 0;
}
int
pim_rpf_is_same (struct pim_rpf *rpf1, struct pim_rpf *rpf2)
{
if (rpf1->source_nexthop.interface == rpf2->source_nexthop.interface)
return 1;
return 0;
}

View File

@ -69,5 +69,6 @@ enum pim_rpf_result pim_rpf_update(struct pim_upstream *up, struct in_addr *old_
int pim_rpf_addr_is_inaddr_none (struct pim_rpf *rpf);
int pim_rpf_addr_is_inaddr_any (struct pim_rpf *rpf);
int pim_rpf_is_same (struct pim_rpf *rpf1, struct pim_rpf *rpf2);
void pim_rpf_set_refresh_time (void);
#endif /* PIM_RPF_H */