]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
JSON: Fix add rule with index
authorPhil Sutter <phil@nwl.cc>
Fri, 1 Jun 2018 15:32:09 +0000 (17:32 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sun, 3 Jun 2018 09:47:22 +0000 (11:47 +0200)
This was missed by commit fb557b5546084 ("JSON: Sort out rule position
and handles in general"): When adding a rule, the parser would still
expect "pos" property instead of "index".

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/parser_json.c

index 394e5039a44762a39b0cd03ed81e569789ea4687..7971553651f2793dc2cbc66f0946162a978fa0da 100644 (file)
@@ -2220,7 +2220,7 @@ static struct cmd *json_parse_cmd_add_rule(struct json_ctx *ctx, json_t *root,
                return NULL;
        }
 
-       json_unpack(root, "{s:i}", "pos", &h.position.id);
+       json_unpack(root, "{s:i}", "index", &h.index.id);
 
        rule = rule_alloc(int_loc, NULL);