Merge pull request #5406 from lkrishnamoor/advertise-routes-bug2

bgpd: Blank RD in "sh bgp l2vpn evpn all neighbors ip advertised-routes json"
This commit is contained in:
Donatas Abraitis 2019-11-22 16:09:22 +02:00 committed by GitHub
commit d813028cf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,9 +85,13 @@ int show_adj_route_vpn(struct vty *vty, struct peer *peer,
if (table == NULL)
continue;
/*
* Initialize variables for each RD
* All prefixes under an RD is aggregated within "json_routes"
*/
rd_header = 1;
memset(rd_str, 0, sizeof(rd_str));
json_routes = NULL;
for (rm = bgp_table_top(table); rm; rm = bgp_route_next(rm)) {
struct bgp_adj_out *adj = NULL;
@ -223,7 +227,7 @@ int show_adj_route_vpn(struct vty *vty, struct peer *peer,
output_count++;
}
if (use_json)
if (use_json && json_routes)
json_object_object_add(json_adv, rd_str, json_routes);
}