]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: fix version attribute is an int, not a string
authorPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 25 Nov 2024 21:47:21 +0000 (22:47 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 26 Nov 2024 10:01:57 +0000 (11:01 +0100)
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>
bgpd/bgp_route.c

index 72e798a7e2c9735dae060bfc52f62c0f5cf85308..5feda718373942569dd90a68d3c1ca9c840a7234 100644 (file)
@@ -12318,8 +12318,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);