summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_route.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgp_route.c')
-rw-r--r--bgpd/bgp_route.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index d3bf9b6f2..570464d1b 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -11186,10 +11186,7 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
else
vty_out(vty, ",\"%pFX\": ", dest_p);
}
- vty_out(vty, "%s",
- json_object_to_json_string_ext(
- json_paths, JSON_C_TO_STRING_PRETTY));
- json_object_free(json_paths);
+ vty_json(vty, json_paths);
json_paths = NULL;
first = 0;
} else
@@ -12043,12 +12040,8 @@ DEFUN(show_ip_bgp_statistics_all, show_ip_bgp_statistics_all_cmd,
bgp_table_stats(vty, bgp, afi, safi, json_afi_safi);
}
- if (uj) {
- vty_out(vty, "%s",
- json_object_to_json_string_ext(
- json_all, JSON_C_TO_STRING_PRETTY));
- json_object_free(json_all);
- }
+ if (uj)
+ vty_json(vty, json_all);
return CMD_SUCCESS;
}
@@ -12089,9 +12082,7 @@ DEFUN (show_ip_bgp_l2vpn_evpn_statistics,
json = json_object_new_object();
json_object_object_add(json, get_afi_safi_str(afi, safi, true),
json_afi_safi);
- vty_out(vty, "%s", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
+ vty_json(vty, json);
}
return ret;
}
@@ -12129,10 +12120,7 @@ DEFUN(show_ip_bgp_afi_safi_statistics, show_ip_bgp_afi_safi_statistics_cmd,
json = json_object_new_object();
json_object_object_add(json, get_afi_safi_str(afi, safi, true),
json_afi_safi);
- vty_out(vty, "%s",
- json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
+ vty_json(vty, json);
}
return ret;
}