Skip to content

Commit

Permalink
pimd: make sure the bsr message is coming from the neighbor
Browse files Browse the repository at this point in the history
This change re-adds an additional check bsr rpf that was removed
in 2c6a32f.

Without that check, bsr messages is resent (causing a loop) if we
have more than one pim neighbor on a link.

Signed-off-by: Jafar Al-Gharaibeh <[email protected]>
  • Loading branch information
Jafaral committed Sep 9, 2024
1 parent c1f8988 commit 569b1d4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pimd/pim_nht.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,8 @@ bool pim_nht_bsr_rpf_check(struct pim_instance *pim, pim_addr bsr_addr,
if (!nbr)
continue;

return znh->ifindex == src_ifp->ifindex;
return znh->ifindex == src_ifp->ifindex &&
(!pim_addr_cmp(znh->nexthop_addr, src_ip));
}
return false;
}
Expand Down Expand Up @@ -404,13 +405,12 @@ bool pim_nht_bsr_rpf_check(struct pim_instance *pim, pim_addr bsr_addr,
return true;

/* MRIB (IGP) may be pointing at a router where PIM is down */

nbr = pim_neighbor_find(ifp, nhaddr, true);

if (!nbr)
continue;

return nh->ifindex == src_ifp->ifindex;
return nh->ifindex == src_ifp->ifindex &&
(!pim_addr_cmp(nhaddr, src_ip));
}
return false;
}
Expand Down

0 comments on commit 569b1d4

Please sign in to comment.