From ca9e5ab31616da31d81ec3ee7c9f84d601a8c00b Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 9 Oct 2019 16:10:44 -0400 Subject: [PATCH] bgpd: AS paths are uint32_t instead of integers We have some JSON output that was displaying high order AS path data as negative numbers: { "paths":[ { "aspath":{ "string":"4200010118 4200010000 20473 1299", "segments":[ { "type":"as-sequence", "list":[ -94957178, -94957296, 20473, 1299 ] } ], Notice "String" output -vs- the list. With fixed code: "paths":[ { "aspath":{ "string":"64539 4294967000 15096 6939 7922 7332 4249", "segments":[ { "type":"as-sequence", "list":[ 64539, 4294967000, 15096, 6939, 7922, 7332, 4249 ] } ], Signed-off-by: Donald Sharp --- bgpd/bgp_aspath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgpd/bgp_aspath.c b/bgpd/bgp_aspath.c index 6caeb7ca1f..4257b601f1 100644 --- a/bgpd/bgp_aspath.c +++ b/bgpd/bgp_aspath.c @@ -576,7 +576,7 @@ static void aspath_make_str_count(struct aspath *as, bool make_json) if (make_json) json_object_array_add( jseg_list, - json_object_new_int(seg->as[i])); + json_object_new_int64(seg->as[i])); len += snprintf(str_buf + len, str_size - len, "%u", seg->as[i]);