]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
cache: Filter for table when listing flowtables
authorPhil Sutter <phil@nwl.cc>
Wed, 25 Feb 2026 20:07:32 +0000 (21:07 +0100)
committerPhil Sutter <phil@nwl.cc>
Wed, 18 Mar 2026 16:21:34 +0000 (17:21 +0100)
Respect an optionally specified table name to filter listed flowtables
to by populating the filter accordingly.

Fixes: a1a6b0a5c3c4 ("cache: finer grain cache population for list commands")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Reviewed-by: Pablo Neira Ayuso <pablo@netfilter.org>
Tested-by: Eric Garver <eric@garver.life>
src/cache.c
tests/shell/testcases/listing/cache_filters

index f86d0006909297f3d5acdd23dc7030f3ff3e538d..bad8275326c76261d741522184f7379ee817c33a 100644 (file)
@@ -266,6 +266,7 @@ static unsigned int evaluate_cache_list(struct nft_ctx *nft, struct cmd *cmd,
                /* fall through */
        case CMD_OBJ_FLOWTABLES:
                filter->list.family = cmd->handle.family;
+               filter->list.table = cmd->handle.table.name;
                flags |= NFT_CACHE_TABLE | NFT_CACHE_FLOWTABLE;
                break;
        case CMD_OBJ_COUNTER:
index 7a89330d2b6c0f227c63e4c9ff7b0fce83d915ab..e3d0e5e5a7217f318775a68ee21405888822cb08 100755 (executable)
@@ -47,4 +47,7 @@ $NFT --debug=netlink list flowtables | \
        grep -q 'flow table ip_t ip_t_ft' || fail "broken list flowtables"
 $NFT --debug=netlink list flowtables ip6 | \
        grep -q 'flow table ip_t ip_t_ft' && fail "broken list flowtables family filter"
+$NFT --debug=netlink list flowtables ip ip_t2 | \
+       grep -q 'flow table ip_t ip_t_ft' && fail "broken list flowtables table filter"
+
 exit 0