]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd: make sure the bsr message is coming from the neighbor
authorJafar Al-Gharaibeh <jafar@atcorp.com>
Fri, 6 Sep 2024 14:57:53 +0000 (09:57 -0500)
committerJafar Al-Gharaibeh <jafar@atcorp.com>
Mon, 9 Sep 2024 22:14:16 +0000 (17:14 -0500)
This change re-adds an additional check bsr rpf that was removed
in 2c6a32f9be3c687fe5c52d055f21912da8364ec6.

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 <jafar@atcorp.com>
pimd/pim_nht.c

index 57dcff3b47104085a1261d88698c8bf597c673d7..030b933e094846ffac885ce19f4f0e050884c087 100644 (file)
@@ -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;
        }
@@ -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;
 }