]> git.ipfire.org Git - thirdparty/nftables.git/commit
json: deal appropriately with multidevice in chain
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 23 Nov 2023 09:36:50 +0000 (10:36 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 23 Nov 2023 10:54:50 +0000 (11:54 +0100)
commit4dfb5b2010917da3f9f11c83931069931a7d6fb3
tree992eebd0976b9c732c71275aba770c7db081e0a5
parentfaa6908fad6053ae9549c45b88d0402cc69cf1ed
json: deal appropriately with multidevice in chain

Chain device support is broken in JSON: listing does not include devices
and parser only deals with one single device.

Use existing json_parse_flowtable_devs() function, rename it to
json_parse_devs() to parse the device array.

Use the dev_array that contains the device names (as string) for the
listing.

Update incorrect .json-nft files in tests/shell.

Fixes: 3fdc7541fba0 ("src: add multidevice support for netdev chain")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/json.c
src/parser_json.c
tests/shell/testcases/chains/dumps/0021prio_0.json-nft
tests/shell/testcases/chains/dumps/0042chain_variable_0.json-nft
tests/shell/testcases/chains/dumps/0043chain_ingress_0.json-nft