diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2025-01-27 23:32:33 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-27 23:32:33 +0200 |
| commit | ee67699bd7e0175057ffab4c8c30c74b6c7cc844 (patch) | |
| tree | 1e024c2372a76ada82abcd673eaca35e05053444 /bgpd | |
| parent | 95db38f394449b6a03b2b9f9e964351eef62e37f (diff) | |
| parent | e78a049c490939be87fa0f5c8c5443b51996d2ab (diff) | |
Merge pull request #17905 from pguibert6WIND/advertised_routes_incorrect_json
Advertised routes incorrect json
Diffstat (limited to 'bgpd')
| -rw-r--r-- | bgpd/bgp_route.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index a2620a5a4c..f2e61e1e7f 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -15245,7 +15245,7 @@ static int peer_adj_routes(struct vty *vty, struct peer *peer, afi_t afi, if (type == bgp_show_adj_route_advertised || type == bgp_show_adj_route_received) { if (first) { - vty_out(vty, "\"%s\":", rd_str); + vty_out(vty, "{\"%s\":", rd_str); first = false; } else { vty_out(vty, ",\"%s\":", rd_str); @@ -15259,6 +15259,8 @@ static int peer_adj_routes(struct vty *vty, struct peer *peer, afi_t afi, output_count += output_count_per_rd; filtered_count += filtered_count_per_rd; } + if (first == false && json_routes) + vty_out(vty, "}"); } else { show_adj_route(vty, peer, table, afi, safi, type, rmap_name, json, json_ar, show_flags, &header1, &header2, |
