diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2024-11-25 22:47:21 +0100 |
|---|---|---|
| committer | Mergify <37929162+mergify[bot]@users.noreply.github.com> | 2024-11-26 13:30:13 +0000 |
| commit | 6f3a0ce4d357d060aeff506e06c300a84794e112 (patch) | |
| tree | e9717e0a2aa3e774211a1bf828df4461a37a0d32 | |
| parent | b4611808cdd6ba3e8e657715ae2768f556d96c25 (diff) | |
bgpd: fix version attribute is an int, not a string
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: f9f2d188e398 ("bgpd: fix 'json detail' output structure")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit c5d7815cccb92c192ca6b752843b8b827a607b53)
| -rw-r--r-- | bgpd/bgp_route.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 2251d70d7c..7c18b17d97 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -12195,8 +12195,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 "\",", - dest->version); + vty_out(vty, "\"version\": %" PRIu64 ",", dest->version); } else { json_object_string_addf(json, "prefix", "%pFX", p); |
