Skip to content

Commit

Permalink
Merge pull request #17249 from FRRouting/mergify/bp/stable/9.1/pr-17217
Browse files Browse the repository at this point in the history
pimd: allow resolving bsr via directly connected secondary address (backport) (backport #17217)
  • Loading branch information
Jafaral authored Oct 26, 2024
2 parents 6e9284a + 22e1d43 commit fbc85e8
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions pimd/pim_nht.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,19 @@ bool pim_nht_bsr_rpf_check(struct pim_instance *pim, pim_addr bsr_addr,
if (!nbr)
continue;

return znh->ifindex == src_ifp->ifindex;
/* Are we on the correct interface? */
if (znh->ifindex == src_ifp->ifindex) {
/* Do we have the correct NH ? */
if (!pim_addr_cmp(znh->nexthop_addr, src_ip))
return true;
/*
* check If the packet came from the neighbor,
* and the dst is a secondary address on the connected interface
*/
return (!pim_addr_cmp(nbr->source_addr, src_ip) &&
pim_if_connected_to_source(ifp, znh->nexthop_addr));
}
return false;
}
return false;
}
Expand Down Expand Up @@ -380,7 +392,19 @@ bool pim_nht_bsr_rpf_check(struct pim_instance *pim, pim_addr bsr_addr,
if (!nbr)
continue;

return nh->ifindex == src_ifp->ifindex;
/* Are we on the correct interface? */
if (nh->ifindex == src_ifp->ifindex) {
/* Do we have the correct NH ? */
if (!pim_addr_cmp(nhaddr, src_ip))
return true;
/*
* check If the packet came from the neighbor,
* and the dst is a secondary address on the connected interface
*/
return (!pim_addr_cmp(nbr->source_addr, src_ip) &&
pim_if_connected_to_source(ifp, nhaddr));
}
return false;
}
return false;
}
Expand Down

0 comments on commit fbc85e8

Please sign in to comment.