From: Phil Sutter Date: Wed, 25 Feb 2026 20:07:32 +0000 (+0100) Subject: cache: Filter for table when listing flowtables X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=fa5d7fba4bcc9b7c5c9ec37bbe8d3df3f8298745;p=thirdparty%2Fnftables.git cache: Filter for table when listing flowtables 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 Reviewed-by: Pablo Neira Ayuso Tested-by: Eric Garver --- diff --git a/src/cache.c b/src/cache.c index f86d0006..bad82753 100644 --- a/src/cache.c +++ b/src/cache.c @@ -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: diff --git a/tests/shell/testcases/listing/cache_filters b/tests/shell/testcases/listing/cache_filters index 7a89330d..e3d0e5e5 100755 --- a/tests/shell/testcases/listing/cache_filters +++ b/tests/shell/testcases/listing/cache_filters @@ -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