]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
json: fix base chain output
authorFlorian Westphal <fw@strlen.de>
Wed, 2 Jun 2021 10:47:24 +0000 (12:47 +0200)
committerFlorian Westphal <fw@strlen.de>
Wed, 2 Jun 2021 11:54:59 +0000 (13:54 +0200)
nft-test.py -j fails with
python: json.c:243: chain_print_json: Assertion `__out' failed.

The member was changed from char * to a struct, pass the name again.

Fixes: 5008798157e2114f ("libnftables: location-based error reporting for chain type")
Signed-off-by: Florian Westphal <fw@strlen.de>
(cherry picked from commit cabe8992b3ee4eb0001a07075b317d966df6bcbd)

src/json.c

index a3d1008fdae87416d684ed642e92ed5354d5260e..e588ef4c1722a03711a30a2a7d3339e32cdc8059 100644 (file)
@@ -241,7 +241,7 @@ static json_t *chain_print_json(const struct chain *chain)
                mpz_export_data(&policy, chain->policy->value,
                                BYTEORDER_HOST_ENDIAN, sizeof(int));
                tmp = json_pack("{s:s, s:s, s:i, s:s}",
-                               "type", chain->type,
+                               "type", chain->type.str,
                                "hook", hooknum2str(chain->handle.family,
                                                    chain->hook.num),
                                "prio", priority,