]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Make code consistent in regards to lookup
authorDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 7 Jul 2018 14:04:30 +0000 (10:04 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 7 Jul 2018 14:15:02 +0000 (10:15 -0400)
In places where we do a pim_ecmp_nexthop_search, also
use pim_ecmp_nexthop_lookup instead of the single path
case of pim_nexthop_lookup.

This is in preparation of more serious surgery to fix
the weird api of pim_find_or_track_nexthop.

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

index a8cf58cd363df3242b1f6c76940d651027b973bb..c837e01549b257b1f46494eb486486e0d706f8f6 100644 (file)
@@ -486,10 +486,9 @@ int pim_rp_new(struct pim_instance *pim, const char *rp,
                                            &rp_all->group, 1))
                                        return PIM_RP_NO_PATH;
                        } else {
-                               if (pim_nexthop_lookup(
+                               if (!pim_ecmp_nexthop_lookup(
                                            pim, &rp_all->rp.source_nexthop,
-                                           rp_all->rp.rpf_addr.u.prefix4, 1)
-                                   != 0)
+                                           &nht_p, &rp_all->group, 1))
                                        return PIM_RP_NO_PATH;
                        }
                        pim_rp_check_interfaces(pim, rp_all);
@@ -571,9 +570,8 @@ int pim_rp_new(struct pim_instance *pim, const char *rp,
                                             &nht_p, &rp_info->group, 1))
                        return PIM_RP_NO_PATH;
        } else {
-               if (pim_nexthop_lookup(pim, &rp_info->rp.source_nexthop,
-                                      rp_info->rp.rpf_addr.u.prefix4, 1)
-                   != 0)
+               if (!pim_ecmp_nexthop_lookup(pim, &rp_info->rp.source_nexthop,
+                                            &nht_p, &rp_info->group, 1))
                        return PIM_RP_NO_PATH;
        }
 
@@ -702,9 +700,9 @@ void pim_rp_setup(struct pim_instance *pim)
                                        "%s: NHT Local Nexthop not found for RP %s ",
                                        __PRETTY_FUNCTION__, buf);
                        }
-                       if (pim_nexthop_lookup(
-                                   pim, &rp_info->rp.source_nexthop,
-                                   rp_info->rp.rpf_addr.u.prefix4, 1) < 0)
+                       if (!pim_ecmp_nexthop_lookup(
+                                                    pim, &rp_info->rp.source_nexthop,
+                                                    &nht_p, &rp_info->group, 1))
                                if (PIM_DEBUG_PIM_NHT_RP)
                                        zlog_debug(
                                                "Unable to lookup nexthop for rp specified");
@@ -869,8 +867,8 @@ struct pim_rpf *pim_rp_g(struct pim_instance *pim, struct in_addr group)
                                        __PRETTY_FUNCTION__, buf, buf1);
                        }
                        pim_rpf_set_refresh_time(pim);
-                       pim_nexthop_lookup(pim, &rp_info->rp.source_nexthop,
-                                          rp_info->rp.rpf_addr.u.prefix4, 1);
+                       pim_ecmp_nexthop_lookup(pim, &rp_info->rp.source_nexthop,
+                                               &nht_p, &rp_info->group, 1);
                }
                return (&rp_info->rp);
        }