summaryrefslogtreecommitdiffstats
path: root/pimd/pim_nht.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-07-11 19:39:08 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-07-24 19:52:57 +0200
commit1b5f8a1a21fb271c5d9c9faa9ca8749fb9038f6f (patch)
tree7bd44ed8bddd6b71d49ed66574aea55fee4816df /pimd/pim_nht.c
parentpimd: Allow installation of NULL mroute in some situations (diff)
downloadfrr-1b5f8a1a21fb271c5d9c9faa9ca8749fb9038f6f.tar.xz
frr-1b5f8a1a21fb271c5d9c9faa9ca8749fb9038f6f.zip
pimd: Stop looking when we find a matching nexthop
When we receive a new ecmp path and the old nexthop is still valid. There existed some cases where we would continue looking for a nexthop( and thus loose the fact that we had found it ) after found. Ticket: CM-16983 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_nht.c')
-rw-r--r--pimd/pim_nht.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/pimd/pim_nht.c b/pimd/pim_nht.c
index 9f80e0ab0..ff0d7b6f3 100644
--- a/pimd/pim_nht.c
+++ b/pimd/pim_nht.c
@@ -489,9 +489,12 @@ int pim_ecmp_nexthop_search(struct pim_instance *pim,
// If the current nexthop is not valid, candidate to
// choose new Nexthop.
for (nh_node = pnc->nexthop; nh_node;
- nh_node = nh_node->next)
+ nh_node = nh_node->next) {
curr_route_valid = (nexthop->interface->ifindex
== nh_node->ifindex);
+ if (curr_route_valid)
+ break;
+ }
if (curr_route_valid
&& !pim_if_connected_to_source(nexthop->interface,
@@ -734,17 +737,6 @@ int pim_parse_nexthop_update(int command, struct zclient *zclient,
break;
}
- if (PIM_DEBUG_PIM_NHT) {
- char p_str[PREFIX2STR_BUFFER];
- prefix2str(&p, p_str, sizeof(p_str));
- zlog_debug(
- "%s: NHT addr %s(%s) %d-nhop via %s type %d distance:%u metric:%u ",
- __PRETTY_FUNCTION__, p_str,
- pim->vrf->name, i + 1,
- inet_ntoa(nexthop->gate.ipv4),
- nexthop->type, distance, metric);
- }
-
ifp = if_lookup_by_index(nexthop->ifindex, pim->vrf_id);
if (!ifp) {
if (PIM_DEBUG_PIM_NHT) {
@@ -761,6 +753,18 @@ int pim_parse_nexthop_update(int command, struct zclient *zclient,
continue;
}
+ if (PIM_DEBUG_PIM_NHT) {
+ char p_str[PREFIX2STR_BUFFER];
+ prefix2str(&p, p_str, sizeof(p_str));
+ zlog_debug(
+ "%s: NHT addr %s(%s) %d-nhop via %s(%s) type %d distance:%u metric:%u ",
+ __PRETTY_FUNCTION__, p_str,
+ pim->vrf->name, i + 1,
+ inet_ntoa(nexthop->gate.ipv4),
+ ifp->name, nexthop->type, distance,
+ metric);
+ }
+
if (!ifp->info) {
if (PIM_DEBUG_PIM_NHT) {
char buf[NEXTHOP_STRLEN];