mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-16 10:38:05 +00:00
bgpd: fix missing braces when dumping json vpn advertised-routes
The json output of advertised-routes is incorrect, as there is a missing
brace with route-distinguisher:
observed with the bgp_vpnv4_noretain test:
> "bgpTableVersion":0,"bgpLocalRouterId":"192.0.2.1","defaultLocPrf":100,"localAS":65500,
> "advertisedRoutes": "192.0.2.1:1":{"rd":"192.0.2.1:1","10.101.0.0/24":{"prefix":"10.101.0.0/24",
expected:
> "bgpTableVersion":0,"bgpLocalRouterId":"192.0.2.1","defaultLocPrf":100,"localAS":65500,
> "advertisedRoutes": { "192.0.2.1:1":{"rd":"192.0.2.1:1","10.101.0.0/24":{"prefix":"10.101.0.0/24",
> ^
> missing brace
Fix this by adding the missing braces.
Fixes: 4838bac033
("bgpd: neighbors received-routes/advertised-routes stringify changes")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This commit is contained in:
parent
d17fce21fc
commit
e78a049c49
@ -15239,7 +15239,7 @@ static int peer_adj_routes(struct vty *vty, struct peer *peer, afi_t afi,
|
|||||||
if (type == bgp_show_adj_route_advertised ||
|
if (type == bgp_show_adj_route_advertised ||
|
||||||
type == bgp_show_adj_route_received) {
|
type == bgp_show_adj_route_received) {
|
||||||
if (first) {
|
if (first) {
|
||||||
vty_out(vty, "\"%s\":", rd_str);
|
vty_out(vty, "{\"%s\":", rd_str);
|
||||||
first = false;
|
first = false;
|
||||||
} else {
|
} else {
|
||||||
vty_out(vty, ",\"%s\":", rd_str);
|
vty_out(vty, ",\"%s\":", rd_str);
|
||||||
@ -15253,6 +15253,8 @@ static int peer_adj_routes(struct vty *vty, struct peer *peer, afi_t afi,
|
|||||||
output_count += output_count_per_rd;
|
output_count += output_count_per_rd;
|
||||||
filtered_count += filtered_count_per_rd;
|
filtered_count += filtered_count_per_rd;
|
||||||
}
|
}
|
||||||
|
if (first == false && json_routes)
|
||||||
|
vty_out(vty, "}");
|
||||||
} else {
|
} else {
|
||||||
show_adj_route(vty, peer, table, afi, safi, type, rmap_name,
|
show_adj_route(vty, peer, table, afi, safi, type, rmap_name,
|
||||||
json, json_ar, show_flags, &header1, &header2,
|
json, json_ar, show_flags, &header1, &header2,
|
||||||
|
Loading…
Reference in New Issue
Block a user