netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nft] json: fix base chain output
@ 2021-06-02 11:37 Florian Westphal
  0 siblings, 0 replies; only message in thread
From: Florian Westphal @ 2021-06-02 11:37 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Florian Westphal

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>
---
 src/json.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/json.c b/src/json.c
index a3d1008fdae8..e588ef4c1722 100644
--- a/src/json.c
+++ b/src/json.c
@@ -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,
-- 
2.26.3


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-02 11:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-02 11:37 [PATCH nft] json: fix base chain output Florian Westphal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).