Skip to content

Commit

Permalink
bgpd: Drop newline in JSON output for show bgp afi safi json detail
Browse files Browse the repository at this point in the history
Before:

```
{
 "vrfId": 0,
 "vrfName": "default",
 "tableVersion": 2,
 "routerId": "1.1.1.1",
 "defaultLocPrf": 100,
 "localAS": 65001,
 "routes": { "192.168.1.0/24": {
"prefix": "192.168.1.0/24",
"version": "1",

"paths": [{"aspath":{"string":"Local","segments":[],"length":0},"origin":"IGP","metric":0,"weight":32768,"valid":true,"version":1,"sourced":true,"local":true,"bestpath":{"overall":true,"selectionReason":"First path received"},"lastUpdate":{"epoch":1713035588,"string":"Sat Apr 13 22:13:08 2024\n"},"nexthops":[{"ip":"0.0.0.0","hostname":"donatas.net","afi":"ipv4","metric":0,"accessible":true,"used":true}],"peer":{"peerId":"0.0.0.0","routerId":"1.1.1.1"}}]
} ,"192.168.11.0/24": {
"prefix": "192.168.11.0/24",
"version": "2",

"paths": [{"aspath":{"string":"Local","segments":[],"length":0},"origin":"IGP","metric":0,"weight":32768,"valid":true,"version":2,"sourced":true,"local":true,"bestpath":{"overall":true,"selectionReason":"First path received"},"lastUpdate":{"epoch":1713035588,"string":"Sat Apr 13 22:13:08 2024\n"},"nexthops":[{"ip":"0.0.0.0","hostname":"donatas.net","afi":"ipv4","metric":0,"accessible":true,"used":true}],"peer":{"peerId":"0.0.0.0","routerId":"1.1.1.1"}}]
}  }  }
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
  • Loading branch information
ton31337 committed Apr 13, 2024
1 parent b6e6656 commit 1dc28e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -11882,7 +11882,7 @@ void route_vty_out_detail_header(struct vty *vty, struct bgp *bgp,
} else {
if (incremental_print) {
vty_out(vty, "\"prefix\": \"%pFX\",\n", p);
vty_out(vty, "\"version\": \"%" PRIu64 "\",\n",
vty_out(vty, "\"version\": \"%" PRIu64 "\",",
dest->version);
} else {
json_object_string_addf(json, "prefix", "%pFX",
Expand Down

0 comments on commit 1dc28e1

Please sign in to comment.