]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
parser_json: Fix typo in ct timeout policy parser
authorPhil Sutter <phil@nwl.cc>
Thu, 25 Apr 2019 12:59:42 +0000 (14:59 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 30 Apr 2019 12:20:57 +0000 (14:20 +0200)
Parser expects an object in policy property and json_is_object() returns
true if given parameter is an object. The check was inverse by accident.

Fixes: c82a26ebf7e9f ("json: Add ct timeout support")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/parser_json.c

index 53017935eba53e0e848932944adcf2d23403c7ac..01f340802bec9fdcb83392e2afbdf38712f98fda 100644 (file)
@@ -2782,7 +2782,7 @@ static int json_parse_ct_timeout_policy(struct json_ctx *ctx,
        if (!json_unpack(root, "{s:o}", "policy", &tmp))
                return 0;
 
-       if (json_is_object(tmp)) {
+       if (!json_is_object(tmp)) {
                json_error(ctx, "Invalid ct timeout policy.");
                return 1;
        }