]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: When doing a RPF for a route, note when we fail the lookup 1389/head
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 30 Oct 2017 17:29:14 +0000 (13:29 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 30 Oct 2017 17:29:14 +0000 (13:29 -0400)
When we ask PIM to do a CLI search of a random (S,G) if the
(S,G) has no RPF due to no route, let the user know about
the issue instead of crashing.

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

index a9239c28354714a29c2b757ba58e476d4441d96e..10b68ab73594f5242e44539b61b5ce235c1136ea 100644 (file)
@@ -4252,11 +4252,16 @@ DEFUN (show_ip_pim_nexthop_lookup,
        memset(&nexthop, 0, sizeof(nexthop));
 
        if (pim_find_or_track_nexthop(vrf->info, &nht_p, NULL, NULL, &pnc))
-               pim_ecmp_nexthop_search(vrf->info, &pnc, &nexthop, &nht_p, &grp,
-                                       0);
+               result = pim_ecmp_nexthop_search(vrf->info, &pnc, &nexthop,
+                                                &nht_p, &grp, 0);
        else
-               pim_ecmp_nexthop_lookup(vrf->info, &nexthop, vif_source, &nht_p,
-                                       &grp, 0);
+               result = pim_ecmp_nexthop_lookup(vrf->info, &nexthop, vif_source,
+                                                &nht_p, &grp, 0);
+
+       if (!result) {
+               vty_out(vty, "Nexthop Lookup failed, no usable routes returned.\n");
+               return CMD_SUCCESS;
+       }
 
        pim_addr_dump("<grp?>", &grp, grp_str, sizeof(grp_str));
        pim_addr_dump("<nexthop?>", &nexthop.mrib_nexthop_addr,