summaryrefslogtreecommitdiffstats
path: root/src/cache.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2023-06-18 18:39:45 +0200
committerFlorian Westphal <fw@strlen.de>2023-06-19 18:17:42 +0200
commit29bed4fa594c3f6e343a8b5669d61e20c7129cca (patch)
treec8dadaaa0cf5aba0fbd7fc02d6267f43daf26979 /src/cache.c
parentcce0d7b174ff5412e8fc1db9614081fe314a87cd (diff)
cache: include set elements in "nft set list"
Make "nft list sets" include set elements in listing by default. In nftables 1.0.0, "nft list sets" did not include the set elements, but with "--json" they were included. 1.0.1 and newer never include them. This causes a problem for people updating from 1.0.0 and relying on the presence of the set elements. Change nftables to always include the set elements. The "--terse" option is honored to get the "no elements" behaviour. Fixes: a1a6b0a5c3c4 ("cache: finer grain cache population for list commands") Link: https://marc.info/?l=netfilter&m=168704941828372&w=2 Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'src/cache.c')
-rw-r--r--src/cache.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cache.c b/src/cache.c
index 95adee7f..becfa57f 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -235,6 +235,8 @@ static unsigned int evaluate_cache_list(struct nft_ctx *nft, struct cmd *cmd,
case CMD_OBJ_SETS:
case CMD_OBJ_MAPS:
flags |= NFT_CACHE_TABLE | NFT_CACHE_SET;
+ if (!nft_output_terse(&nft->output))
+ flags |= NFT_CACHE_SETELEM;
break;
case CMD_OBJ_FLOWTABLE:
if (filter &&