Skip to contentSkip to conversation

json: fix base chain output

PATCH New Florian Westphal 1 participant 1 message Jun 2, 2021 netfilter

lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH 1/1 json: fix base chain output

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")
---
 src/json.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/json.c +1 -1
index a3d1008fdae8..e588ef4c1722 100644
@@ -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,
Signature · 1 line
2.26.3