diff options
| author | Trey Aspelund <taspelund@nvidia.com> | 2023-02-10 19:05:27 +0000 |
|---|---|---|
| committer | Trey Aspelund <taspelund@nvidia.com> | 2023-02-16 16:05:16 +0000 |
| commit | f9f2d188e3980d2338747739848001a432ad30b2 (patch) | |
| tree | ac5e2ee9c082ae1dd5aa445c63d2eea51416dda9 /zebra/zebra_errors.c | |
| parent | bf9bc2e5f2213069801dd1445abc2bfa95214fdf (diff) | |
bgpd: fix 'json detail' output structure
"show bgp <afi> <safi> json detail" was incorrectly displaying header
information from route_vty_out_detail_header() as an element of the
"paths" array. This corrects the behavior for 'json detail' so that a
route holds a dictionary with keys for "paths" and header info, which
aligns with how we structure the output for a specific prefix, e.g.
"show bgp <afi> <safi> <prefix> json".
Before:
```
ub20# show ip bgp json detail
{
"vrfId": 0,
"vrfName": "default",
"tableVersion": 3,
"routerId": "100.64.0.222",
"defaultLocPrf": 100,
"localAS": 1,
"routes": { "2.2.2.2/32": [
{ <<<<<<<<< should be outside the array
"prefix":"2.2.2.2/32",
"version":1,
"advertisedTo":{
"192.168.122.12":{
"hostname":"ub20-2"
}
}
},
{
"aspath":{
"string":"Local",
"segments":[
],
"length":0
},
<snip>
```
After:
```
ub20# show ip bgp json detail
{
"vrfId": 0,
"vrfName": "default",
"tableVersion": 3,
"routerId": "100.64.0.222",
"defaultLocPrf": 100,
"localAS": 1,
"routes": { "2.2.2.2/32": {
"prefix": "2.2.2.2/32",
"version": "1",
"advertisedTo": {
"192.168.122.12":{
"hostname":"ub20-2"
}
}
,"paths": [
{
"aspath":{
"string":"Local",
"segments":[
],
"length":0
},
```
Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
Diffstat (limited to 'zebra/zebra_errors.c')
0 files changed, 0 insertions, 0 deletions
