]> git.puffer.fish Git - mirror/frr.git/commitdiff
vtysh json output not JSON for show ip bgp neigh json
authorSam Tannous <stannous@cumulusnetworks.com>
Thu, 9 Jun 2016 16:26:06 +0000 (12:26 -0400)
committerSam Tannous <stannous@cumulusnetworks.com>
Thu, 9 Jun 2016 16:26:06 +0000 (12:26 -0400)
Ticket: CM-11350
Reviewed By: dsharp
Testing Done: built amd64 images and tested output of both json and non-json

Upstream patch was applied in wrong section of code so JSON
output contained plain text.   The upstream patch was
commit baa376fc1 (cherry picked from ef757700d0f)

This patch moves the text output to the correct if clause
and also adds a new JSON line for the same data.

Signed-off-by: Sam Tannous <stannous@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd/bgp_vty.c

index 259033cb1f5e1d025accd26e196b35ae429efe3d..5ff8c25f19a05164cb8869d96605c7162fc1fd70 100644 (file)
@@ -12054,14 +12054,11 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
         }
     }
 
-  /* TCP metrics. */
-  if (p->status == Established && p->rtt)
-    vty_out (vty, "Estimated round trip time: %d ms%s",
-            p->rtt, VTY_NEWLINE);
-
   /* Timer information. */
   if (use_json)
     {
+      if (p->status == Established && p->rtt)
+        json_object_int_add(json_neigh, "estimatedRttInMsecs", p->rtt);
       if (p->t_start)
         json_object_int_add(json_neigh, "nextStartTimerDueInMsecs", thread_timer_remain_second (p->t_start) * 1000);
       if (p->t_connect)
@@ -12083,6 +12080,10 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
     }
   else
     {
+      /* TCP metrics. */
+      if (p->status == Established && p->rtt)
+        vty_out (vty, "Estimated round trip time: %d ms%s",
+                 p->rtt, VTY_NEWLINE);
       if (p->t_start)
         vty_out (vty, "Next start timer due in %ld seconds%s",
                  thread_timer_remain_second (p->t_start), VTY_NEWLINE);