]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
parser_json: Fix limit object burst value parsing
authorPhil Sutter <phil@nwl.cc>
Wed, 20 Sep 2023 17:37:21 +0000 (19:37 +0200)
committerPhil Sutter <phil@nwl.cc>
Fri, 22 Sep 2023 08:55:25 +0000 (10:55 +0200)
The field is of type uint32_t, use lower case 'i' format specifier.

Fixes: c36288dbe2ba3 ("JSON: Fix parsing and printing of limit objects")
Signed-off-by: Phil Sutter <phil@nwl.cc>
src/parser_json.c

index 57c2c2a9bc432a75dfa609822332e35df53d3259..ddd9c496b57f7f010588e75406eb5998b0ed2ed0 100644 (file)
@@ -3616,7 +3616,7 @@ static struct cmd *json_parse_cmd_add_object(struct json_ctx *ctx,
                }
                json_unpack(root, "{s:s}", "rate_unit", &rate_unit);
                json_unpack(root, "{s:b}", "inv", &inv);
-               json_unpack(root, "{s:I}", "burst", &obj->limit.burst);
+               json_unpack(root, "{s:i}", "burst", &obj->limit.burst);
                json_unpack(root, "{s:s}", "burst_unit", &burst_unit);
 
                if (!strcmp(rate_unit, "packets")) {