diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-04-17 19:12:44 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-04-17 19:12:44 -0400 |
| commit | 0f5ec54a693d7309c7095da45575068a8add84fe (patch) | |
| tree | eea686ad132aef1309e91f3a025a50e25e6ac6bf /ospfd/ospf_vty.c | |
| parent | b43d5ea3302a62133e249d0659e531becbcfbe8b (diff) | |
| parent | 3060be2af51b4a6936b60843ec398607a992002f (diff) | |
Merge remote-tracking branch 'origin/stable/3.0'
Diffstat (limited to 'ospfd/ospf_vty.c')
| -rw-r--r-- | ospfd/ospf_vty.c | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 49474df826..b4c456e0aa 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -3557,7 +3557,7 @@ show_ip_ospf_interface_common (struct vty *vty, struct ospf *ospf, int argc, VTY_NEWLINE, VTY_NEWLINE); } - if (argc == (iface_argv + 1)) + if (argc == iface_argv) { /* Show All Interfaces.*/ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp)) @@ -3570,25 +3570,6 @@ show_ip_ospf_interface_common (struct vty *vty, struct ospf *ospf, int argc, } } } - else if (argv[iface_argv] && strcmp(argv[iface_argv]->arg, "json") == 0) - { - if (!use_json) - { - json = json_object_new_object(); - json_interface_sub = json_object_new_object (); - use_json = 1; - } - /* Show All Interfaces. */ - for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp)) - { - if (ospf_oi_count(ifp)) - { - show_ip_ospf_interface_sub (vty, ospf, ifp, json_interface_sub, use_json); - if (use_json) - json_object_object_add(json, ifp->name, json_interface_sub); - } - } - } else { /* Interface name is specified. */ @@ -3634,7 +3615,10 @@ DEFUN (show_ip_ospf_interface, if ((ospf = ospf_lookup()) == NULL || !ospf->oi_running) return CMD_SUCCESS; - return show_ip_ospf_interface_common(vty, ospf, argc, argv, 0, uj); + if (uj) + argc--; + + return show_ip_ospf_interface_common(vty, ospf, argc, argv, 4, uj); } DEFUN (show_ip_ospf_instance_interface, @@ -3657,7 +3641,10 @@ DEFUN (show_ip_ospf_instance_interface, if ((ospf = ospf_lookup_instance (instance)) == NULL || !ospf->oi_running) return CMD_SUCCESS; - return show_ip_ospf_interface_common(vty, ospf, argc, argv, 1, uj); + if (uj) + argc--; + + return show_ip_ospf_interface_common(vty, ospf, argc, argv, 5, uj); } static void |
