diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-07-28 12:44:20 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-07-29 23:40:58 +0200 |
commit | 8eece29518257536711657c42047f14e22a7e8f2 (patch) | |
tree | 3e439938659b6f5a3704dcf61e71cf67a913c2c3 /src/rule.c | |
parent | 003a78e90279e6d0c5ec3c91b6b8112cbbb22bc1 (diff) |
evaluate: flush set cache from the evaluation phase
This patch reworks 40ef308e19b6 ("rule: flush set cache before flush
command"). This patch flushes the set cache earlier, from the command
evaluation step.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/rule.c')
-rw-r--r-- | src/rule.c | 16 |
1 files changed, 0 insertions, 16 deletions
@@ -2693,21 +2693,6 @@ static int do_command_reset(struct netlink_ctx *ctx, struct cmd *cmd) return do_list_obj(ctx, cmd, type); } -static void flush_set_cache(struct netlink_ctx *ctx, struct cmd *cmd) -{ - struct table *table; - struct set *set; - - table = table_lookup(&cmd->handle, &ctx->nft->cache); - assert(table); - set = set_lookup(table, cmd->handle.set.name); - assert(set); - if (set->init != NULL) { - expr_free(set->init); - set->init = NULL; - } -} - static int do_command_flush(struct netlink_ctx *ctx, struct cmd *cmd) { switch (cmd->obj) { @@ -2717,7 +2702,6 @@ static int do_command_flush(struct netlink_ctx *ctx, struct cmd *cmd) case CMD_OBJ_SET: case CMD_OBJ_MAP: case CMD_OBJ_METER: - flush_set_cache(ctx, cmd); return mnl_nft_setelem_flush(ctx, cmd); case CMD_OBJ_RULESET: return mnl_nft_table_del(ctx, cmd); |