summaryrefslogtreecommitdiffstats
path: root/pimd/pim_rpf.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2016-10-25 16:40:04 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-12-22 02:26:12 +0100
commit518e5727b40b97827b92555bf8d867d642c91bc4 (patch)
tree6571098cc27e42f7093d781fa306fa6d221f2eaa /pimd/pim_rpf.c
parentpimd: Fix uninitialized value (diff)
downloadfrr-518e5727b40b97827b92555bf8d867d642c91bc4.tar.xz
frr-518e5727b40b97827b92555bf8d867d642c91bc4.zip
pimd: Fix pim_nexthop_lookup
There are situations where we may never look at a better route for nexthop_lookup. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_rpf.c')
-rw-r--r--pimd/pim_rpf.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/pimd/pim_rpf.c b/pimd/pim_rpf.c
index ffedd8410..d32d65fd4 100644
--- a/pimd/pim_rpf.c
+++ b/pimd/pim_rpf.c
@@ -59,7 +59,7 @@ int pim_nexthop_lookup(struct pim_nexthop *nexthop, struct in_addr addr, int nei
return -1;
}
- while (!found)
+ while (!found && (i < num_ifindex))
{
first_ifindex = nexthop_tab[i].ifindex;
@@ -77,16 +77,19 @@ int pim_nexthop_lookup(struct pim_nexthop *nexthop, struct in_addr addr, int nei
return -2;
}
- if (!ifp->info && PIM_DEBUG_ZEBRA)
+ if (!ifp->info)
{
- char addr_str[INET_ADDRSTRLEN];
- pim_inet4_dump("<addr?>", addr, addr_str, sizeof(addr_str));
- zlog_debug("%s: multicast not enabled on input interface %s (ifindex=%d, RPF for source %s)",
- __PRETTY_FUNCTION__,
- ifp->name, first_ifindex, addr_str);
+ if (PIM_DEBUG_ZEBRA)
+ {
+ char addr_str[INET_ADDRSTRLEN];
+ pim_inet4_dump("<addr?>", addr, addr_str, sizeof(addr_str));
+ zlog_debug("%s: multicast not enabled on input interface %s (ifindex=%d, RPF for source %s)",
+ __PRETTY_FUNCTION__,
+ ifp->name, first_ifindex, addr_str);
+ }
+ i++;
}
-
- if (neighbor_needed && !pim_if_connected_to_source (ifp, addr))
+ else if (neighbor_needed && !pim_if_connected_to_source (ifp, addr))
{
struct pim_neighbor *nbr;