diff options
| author | Pablo Neira Ayuso <pablo@netfilter.org> | 2024-08-15 12:34:13 +0200 |
|---|---|---|
| committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2024-08-19 17:30:17 +0200 |
| commit | aab2fe87a665c0cba2676096b49b5c8ea21910f8 (patch) | |
| tree | 4a7aa250912c55357fbc6c99b1268b7bcb831099 /src/cmd.c | |
| parent | babc6ee8773cfeed78167f78827b35e3141e04c6 (diff) | |
cache: populate objects on demand from error path
Objects are only required for error reporting hints if kernel reports
ENOENT. Populate the cache from this error path only.
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.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -169,6 +169,10 @@ static int nft_cmd_enoent_obj(struct netlink_ctx *ctx, const struct cmd *cmd, if (!cmd->handle.obj.name) return 0; + if (nft_cache_update(ctx->nft, NFT_CACHE_TABLE | NFT_CACHE_OBJECT, + ctx->msgs, NULL) < 0) + return 0; + obj = obj_lookup_fuzzy(cmd->handle.obj.name, &ctx->nft->cache, &table); /* check table first. */ if (!table) |
