summaryrefslogtreecommitdiffstats
path: root/ospfd
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2017-06-02 21:10:03 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2017-06-04 20:50:12 +0200
commit7d6e13e13838ca05573ac28e1cc4ace4585ed6e2 (patch)
tree9ba7b4205cf9c7c9deb744ef923820f5f17eb036 /ospfd
parentospfd: shufflin (diff)
downloadfrr-7d6e13e13838ca05573ac28e1cc4ace4585ed6e2.tar.xz
frr-7d6e13e13838ca05573ac28e1cc4ace4585ed6e2.zip
ospfd: fix 'show ip ospf interface json'
json obj not recreated for each interface Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ospf_vty.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index 49840a34b..0eb3aa6a8 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -3536,7 +3536,6 @@ show_ip_ospf_interface_common (struct vty *vty, struct ospf *ospf, int argc,
if (use_json)
{
json = json_object_new_object();
- json_interface_sub = json_object_new_object();
}
if (ospf->instance)
@@ -3555,7 +3554,11 @@ show_ip_ospf_interface_common (struct vty *vty, struct ospf *ospf, int argc,
{
if (ospf_oi_count(ifp))
{
+ if (use_json)
+ json_interface_sub = json_object_new_object();
+
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);
}
@@ -3573,7 +3576,11 @@ show_ip_ospf_interface_common (struct vty *vty, struct ospf *ospf, int argc,
}
else
{
+ if (use_json)
+ json_interface_sub = json_object_new_object();
+
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);
}