]> git.ipfire.org Git - thirdparty/nftables.git/commit
ct timeout: fix 'list object x' vs. 'list objects in table' confusion
authorFlorian Westphal <fw@strlen.de>
Mon, 19 Jun 2023 20:43:06 +0000 (22:43 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 13 Aug 2025 16:23:05 +0000 (18:23 +0200)
commit4ab2cdf0e1ab13a15e8845c2c173c911b362a0d7
treee141cf7019f4023f952486d2e2bef8184c9a2c43
parenta66f608222f2b81100265bc10014c69bc633b140
ct timeout: fix 'list object x' vs. 'list objects in table' confusion

commit 1d2e22fc0521bcf73ee1f891c291dc1bde47a6bb upstream.

<empty ruleset>
$ nft list ct timeout table t
Error: No such file or directory
list ct timeout table t
                      ^
This is expected to list all 'ct timeout' objects.
The failure is correct, the table 't' does not exist.

But now lets add one:
$ nft add table t
$ nft list ct timeout  table t
Segmentation fault (core dumped)

... and thats not expected, nothing should be shown
and nft should exit normally.

Because of missing TIMEOUTS command enum, the backend thinks
it should do an object lookup, but as frontend asked for
'list of objects' rather than 'show this object',
handle.obj.name is NULL, which then results in this crash.

Update the command enums so that backend knows what the
frontend asked for.

Signed-off-by: Florian Westphal <fw@strlen.de>
include/rule.h
src/cache.c
src/evaluate.c
src/parser_bison.y
src/rule.c