diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-07-19 21:02:35 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-07-28 14:11:28 +0200 |
commit | 07a2935559b6c32782ced4ef841125d9c102fecf (patch) | |
tree | e54269ce722d4dad3049dd790e6e4ae6aca7a68b /pimd | |
parent | pimd: Fix msdp cleanup issues (diff) | |
download | frr-07a2935559b6c32782ced4ef841125d9c102fecf.tar.xz frr-07a2935559b6c32782ced4ef841125d9c102fecf.zip |
pimd: fix `show ip msdp...` NPD when vrf unknown
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'pimd')
-rw-r--r-- | pimd/pim_cmd.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index 9cd73cbbf..06ca834b1 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -7900,11 +7900,18 @@ DEFUN (show_ip_msdp_peer_detail, u_char uj = use_json(argc, argv); int idx = 2; struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx); - if (uj) - argc--; - if (argv_find(argv, argc, "detail", &idx) - || argv_find(argv, argc, "A.B.C.D", &idx)) + if (!vrf) + return CMD_WARNING; + + char *arg = NULL; + + if (argv_find(argv, argc, "detail", &idx)) + arg = argv[idx]->text; + else if (argv_find(argv, argc, "A.B.C.D", &idx)) + arg = argv[idx]->arg; + + if (arg) ip_msdp_show_peers_detail(vrf->info, vty, argv[idx]->arg, uj); else ip_msdp_show_peers(vrf->info, vty, uj); |