diff options
Diffstat (limited to 'bgpd/bgp_vpn.c')
| -rw-r--r-- | bgpd/bgp_vpn.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/bgpd/bgp_vpn.c b/bgpd/bgp_vpn.c index 8d2cffbb47..6308936aa8 100644 --- a/bgpd/bgp_vpn.c +++ b/bgpd/bgp_vpn.c @@ -118,15 +118,11 @@ int show_adj_route_vpn(struct vty *vty, struct peer *peer, if (header) { if (use_json) { - char buf[BUFSIZ] = {0}; - json_object_int_add( json, "bgpTableVersion", 0); - json_object_string_add( + json_object_string_addf( json, "bgpLocalRouterId", - inet_ntop(AF_INET, - &bgp->router_id, buf, - sizeof(buf))); + "%pI4", &bgp->router_id); json_object_int_add( json, "defaultLocPrf", @@ -243,9 +239,7 @@ int show_adj_route_vpn(struct vty *vty, struct peer *peer, json_object_object_add(json, "advertisedRoutes", json_adv); json_object_int_add(json, "totalPrefixCounter", output_count); - vty_out(vty, "%s\n", json_object_to_json_string_ext( - json, JSON_C_TO_STRING_PRETTY)); - json_object_free(json); + vty_json(vty, json); } else vty_out(vty, "\nTotal number of prefixes %ld\n", output_count); |
