diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-03-28 15:26:06 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-03-28 15:51:49 -0400 |
| commit | f43593d958332b45afedad9216fd55adf99560cf (patch) | |
| tree | d0bcb362a46a1172cc30d3fa935c2e0539fcaff5 /pimd/pim_rp.c | |
| parent | 4f9aec30ead36414971ffb1317a3f23d6b413206 (diff) | |
pimd: Reduce RP checks a bit
The pim_rp_check_is_my_ip_address function was checking to see
if we were the actual RP as well as the pim_register code
was doing the same thing. Remove the reduncancy a bit and
just make this function check for that we are the actual receiver
of this data.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_rp.c')
| -rw-r--r-- | pimd/pim_rp.c | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/pimd/pim_rp.c b/pimd/pim_rp.c index 7094b93a45..0a98a2f7e9 100644 --- a/pimd/pim_rp.c +++ b/pimd/pim_rp.c @@ -1091,34 +1091,13 @@ int pim_rp_config_write(struct pim_instance *pim, struct vty *vty, return count; } -int pim_rp_check_is_my_ip_address(struct pim_instance *pim, - struct in_addr group, - struct in_addr dest_addr) +bool pim_rp_check_is_my_ip_address(struct pim_instance *pim, + struct in_addr dest_addr) { - struct rp_info *rp_info; - struct prefix g; - - memset(&g, 0, sizeof(g)); - g.family = AF_INET; - g.prefixlen = 32; - g.u.prefix4 = group; - - rp_info = pim_rp_find_match_group(pim, &g); - /* - * See if we can short-cut some? - * This might not make sense if we ever leave a static RP - * type of configuration. - * Note - Premature optimization might bite our patooeys' here. - */ - if (I_am_RP(pim, group)) { - if (dest_addr.s_addr == rp_info->rp.rpf_addr.u.prefix4.s_addr) - return 1; - } - if (if_lookup_exact_address(&dest_addr, AF_INET, pim->vrf_id)) - return 1; + return true; - return 0; + return false; } void pim_rp_show_information(struct pim_instance *pim, struct vty *vty, bool uj) |
