diff options
| author | Jafar Al-Gharaibeh <jafar@atcorp.com> | 2024-10-27 23:43:35 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-27 23:43:35 -0500 |
| commit | c66186f6464ef50c6b83ad4b06bc5fe7f54c92ed (patch) | |
| tree | bf5bbff41e6c015e05ca7c2f5e17267e2939aa8e | |
| parent | 428700753963a129a4f8ffa242195cd1e2a6cd48 (diff) | |
| parent | ae02210bdb6ec8294738fc4246e208ad176d945a (diff) | |
Merge pull request #17247 from FRRouting/mergify/bp/stable/10.0/pr-17217
pimd: allow resolving bsr via directly connected secondary address (backport) (backport #17217)
| -rw-r--r-- | pimd/pim_nht.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/pimd/pim_nht.c b/pimd/pim_nht.c index 32cdf4bf82..7fd1f36f4e 100644 --- a/pimd/pim_nht.c +++ b/pimd/pim_nht.c @@ -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; } @@ -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; } |
