summaryrefslogtreecommitdiffstats
path: root/src/cmd.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2024-08-15 12:47:54 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2024-08-19 17:30:22 +0200
commitba13acf4be081129d5c943db9f607a13954be5f6 (patch)
treef4a817ec1ec0740fcc47c11fc3097689d08e70fe /src/cmd.c
parent52d99078521f0ae245ad0145348bebdba9f665ab (diff)
cache: do not fetch set inconditionally on delete
This is only required to remove elements, relax cache requirements for anything else. Tested-by: Eric Garver <eric@garver.life> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/cmd.c')
-rw-r--r--src/cmd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cmd.c b/src/cmd.c
index e64171e7..9a572b56 100644
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -140,6 +140,10 @@ static int nft_cmd_enoent_set(struct netlink_ctx *ctx, const struct cmd *cmd,
if (!cmd->handle.set.name)
return 0;
+ if (nft_cache_update(ctx->nft, NFT_CACHE_TABLE | NFT_CACHE_SET,
+ ctx->msgs, NULL) < 0)
+ return 0;
+
set = set_lookup_fuzzy(cmd->handle.set.name, &ctx->nft->cache, &table);
/* check table first. */
if (!table)