Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pimd,pim6d: Set RP to true if the address matches, ignore prefix-length #11593

Merged
merged 1 commit into from
Jul 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
pimd,pim6d: Set RP to true if the address matches, ignore prefix-length
The API pim_rp_check_interface_addrs checks if the RP address matches
with the primary address then it returns true.
In case of PIMv4 this condition is true, therefore the router becomes RP.
But in case of PIMv6, this condition does not pass because primary address
for PIMv6 is link-local address.

Also PIMv4 allows secondary addresses to be used as RP
if it is a host route in case primary does not match.

Fixing it by only checking the configured
RP address with the interface address and ignoring the prefix
length since it does not matter.

Fixes: #11335

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
  • Loading branch information
mobash-rasool committed Jul 13, 2022
commit c6c615c12b77e45eb09caf442e622dfd1b2db7c1
10 changes: 5 additions & 5 deletions pimd/pim_rp.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,7 @@ static int pim_rp_check_interface_addrs(struct rp_info *rp_info,
{
struct listnode *node;
struct pim_secondary_addr *sec_addr;
struct prefix rpf_addr;

pim_addr_to_prefix(&rpf_addr, rp_info->rp.rpf_addr);
pim_addr sec_paddr;

if (!pim_addr_cmp(pim_ifp->primary_address, rp_info->rp.rpf_addr))
return 1;
Expand All @@ -351,9 +349,11 @@ static int pim_rp_check_interface_addrs(struct rp_info *rp_info,
}

for (ALL_LIST_ELEMENTS_RO(pim_ifp->sec_addr_list, node, sec_addr)) {
if (prefix_same(&sec_addr->addr, &rpf_addr)) {
sec_paddr = pim_addr_from_prefix(&sec_addr->addr);
/* If an RP-address is self, It should be enough to say
* I am RP the prefix-length should not matter here */
if (!pim_addr_cmp(sec_paddr, rp_info->rp.rpf_addr))
return 1;
}
}

return 0;
Expand Down