]> git.ipfire.org Git - thirdparty/nftables.git/commit
json: Dump flowtable hook spec only if present
authorPhil Sutter <phil@nwl.cc>
Wed, 11 Jun 2025 14:45:48 +0000 (16:45 +0200)
committerPhil Sutter <phil@nwl.cc>
Thu, 12 Jun 2025 20:55:46 +0000 (22:55 +0200)
commit9fa3fbed73a36111e308c9856514a032f5444564
tree4a4dc5a1c08df98438bc2ac07522726632263403
parent18ddac660dfa19a4d18fa850b377802011a76393
json: Dump flowtable hook spec only if present

If there is no priority.expr set, assume hook.num is bogus, too.

While this is fixing JSON output, it's hard to tell what commit this is
actually fixing: Before commit 627c451b23513 ("src: allow variables in
the chain priority specification"), there was no way to detect
flowtables missing hook specs (e.g. when printing flowtable delete
monitor event).

Signed-off-by: Phil Sutter <phil@nwl.cc>
Reviewed-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/json.c
tests/monitor/testcases/flowtable-simple.t