Skip to content

Commit

Permalink
bgpd: fix version attribute is an int, not a string
Browse files Browse the repository at this point in the history
The json display of the version attribute is originally an
integer. It has changed, most probably mistakenly.

> {
>   "vrfId": 7,
>   "vrfName": "vrf1",
>   "tableVersion": 3,
>   "routerId": "192.0.2.1",
>   "defaultLocPrf": 100,
>   "localAS": 65500,
>   "routes": {
>     "172.31.0.1/32": {
>       "prefix": "172.31.0.1/32",
>       "version": "1",		<--- int or string ??

Let us fix it, by using the integer display instead.

Fixes: f9f2d18 ("bgpd: fix 'json detail' output structure")

Signed-off-by: Philippe Guibert <[email protected]>
(cherry picked from commit c5d7815)

# Conflicts:
#	bgpd/bgp_route.c
  • Loading branch information
pguibert6WIND authored and mergify[bot] committed Nov 26, 2024
1 parent 63be9cf commit 97061d1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -11817,8 +11817,12 @@ void route_vty_out_detail_header(struct vty *vty, struct bgp *bgp,
} else {
if (incremental_print) {
vty_out(vty, "\"prefix\": \"%pFX\",\n", p);
<<<<<<< HEAD
vty_out(vty, "\"version\": \"%" PRIu64 "\",\n",
dest->version);
=======
vty_out(vty, "\"version\": %" PRIu64 ",", dest->version);
>>>>>>> c5d7815ccc (bgpd: fix version attribute is an int, not a string)
} else {
json_object_string_addf(json, "prefix", "%pFX",
p);
Expand Down

0 comments on commit 97061d1

Please sign in to comment.