diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-10-30 18:29:14 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-10-30 18:29:14 +0100 |
commit | 9993f22cb10e653d9deaac262edadc6abf277894 (patch) | |
tree | 9705edaba0ba7efa572fecdd4b6aed20fa534d12 /pimd/pim_cmd.c | |
parent | Merge pull request #1365 from donaldsharp/pim_vrf_cleanup (diff) | |
download | frr-9993f22cb10e653d9deaac262edadc6abf277894.tar.xz frr-9993f22cb10e653d9deaac262edadc6abf277894.zip |
pimd: When doing a RPF for a route, note when we fail the lookup
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>
Diffstat (limited to 'pimd/pim_cmd.c')
-rw-r--r-- | pimd/pim_cmd.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index a9239c283..10b68ab73 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -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, |