]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Limit lookup of neighbor since we know we have one
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 1 Apr 2019 16:31:28 +0000 (12:31 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 2 Apr 2019 12:20:02 +0000 (08:20 -0400)
When a new pim neighbor comes up, we need to go through and
mark nexthops that we have received from zebra for reachability
tracking so we can refigure stuff.  If we pass in the new neighbor
we can limit the search to those nexthops out the interface that
the new neighbor has come up.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_neighbor.c
pimd/pim_rp.c
pimd/pim_rp.h

index 436f2dec277e723e1fc748546289e61c688b7789..a63b09fc1f9a05b4119bb85eefda954224788010 100644 (file)
@@ -540,7 +540,7 @@ pim_neighbor_add(struct interface *ifp, struct in_addr source_addr,
           Upon PIM neighbor UP, iterate all RPs and update
           nexthop cache with this neighbor.
         */
-       pim_resolve_rp_nh(pim_ifp->pim);
+       pim_resolve_rp_nh(pim_ifp->pim, neigh);
 
        pim_rp_setup(pim_ifp->pim);
 
index b7db7d04187fc100ea57bca967a873f6eb68b2f2..4e285720a205694a237d6fe4326420deed052e7c 100644 (file)
@@ -1206,14 +1206,13 @@ void pim_rp_show_information(struct pim_instance *pim, struct vty *vty, bool uj)
        }
 }
 
-void pim_resolve_rp_nh(struct pim_instance *pim)
+void pim_resolve_rp_nh(struct pim_instance *pim, struct pim_neighbor *nbr)
 {
        struct listnode *node = NULL;
        struct rp_info *rp_info = NULL;
        struct nexthop *nh_node = NULL;
        struct prefix nht_p;
        struct pim_nexthop_cache pnc;
-       struct pim_neighbor *nbr = NULL;
 
        for (ALL_LIST_ELEMENTS_RO(pim->rp_list, node, rp_info)) {
                if (rp_info->rp.rpf_addr.u.prefix4.s_addr == INADDR_NONE)
@@ -1233,8 +1232,8 @@ void pim_resolve_rp_nh(struct pim_instance *pim)
 
                        struct interface *ifp1 = if_lookup_by_index(
                                nh_node->ifindex, pim->vrf_id);
-                       nbr = pim_neighbor_find_if(ifp1);
-                       if (!nbr)
+
+                       if (nbr->interface != ifp1)
                                continue;
 
                        nh_node->gate.ipv4 = nbr->source_addr;
index e0f8e16be0d37e1e549b4eeb1d19c8ea8936f714..402ec30aba270167bdc4500dcbe81e5a54eba8dc 100644 (file)
@@ -68,7 +68,7 @@ struct pim_rpf *pim_rp_g(struct pim_instance *pim, struct in_addr group);
 
 void pim_rp_show_information(struct pim_instance *pim, struct vty *vty,
                             bool uj);
-void pim_resolve_rp_nh(struct pim_instance *pim);
+void pim_resolve_rp_nh(struct pim_instance *pim, struct pim_neighbor *nbr);
 int pim_rp_list_cmp(void *v1, void *v2);
 struct rp_info *pim_rp_find_match_group(struct pim_instance *pim,
                                        const struct prefix *group);