]> git.ipfire.org Git - thirdparty/nftables.git/commit
cache: honor -c/--check for reset commands
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 11 May 2026 19:51:43 +0000 (21:51 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 11 May 2026 20:05:26 +0000 (22:05 +0200)
commit25f2ff13cf6bc84a16febddcf8c3eda2018c7ece
tree915bd0fdc6568473afd3c580c4864e235a43e382
parent82a289074c02ae7fe1eee06ff90b3b062ad8a74e
cache: honor -c/--check for reset commands

Currently:

  nft -c reset rules ip x

ignores -c/--check.

The reset and list commands use the netlink GET/DUMP nfnetlink API which
provides no check semantics, compared to the NEW/DELETE nfnetlink batch
API which indeed does.

Emulate -c/--check for the reset command by handling this as a list
command, so the state of the objects is just listed, not reset. This
allows to check for presence and dump the content of the objects.

Fixes: dbff26bfba83 ("cache: consolidate reset command")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/cache.c