summaryrefslogtreecommitdiffstats
path: root/src/evaluate.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2017-08-15 13:59:12 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2017-08-15 14:03:36 +0200
commit2caecefe812e4d614687926d259ade3106935c56 (patch)
tree7f4ba44760c607f2936d758b97771ed4f8501552 /src/evaluate.c
parentb2506e5504fed23ca9229ea398cab8998aa03712 (diff)
echo: Fix for added delays in rule updates
The added cache update upon every command dealing with rules was a bummer. Instead, perform the needed cache update only if echo option was set. Initially, I tried to perform the cache update from within netlink_echo_callback(), but that turned into a mess since the shared socket between cache_init() and mnl_batch_talk() would receive unexpected new input. So instead update the cache from do_command_add(), netlink_replace_rule_batch() and do_comand_insert() so it completes before mnl_batch_talk() starts listening. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/evaluate.c')
-rw-r--r--src/evaluate.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/src/evaluate.c b/src/evaluate.c
index 64e14b8b..0fad0913 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -2965,10 +2965,6 @@ static int cmd_evaluate_add(struct eval_ctx *ctx, struct cmd *cmd)
handle_merge(&cmd->set->handle, &cmd->handle);
return set_evaluate(ctx, cmd->set);
case CMD_OBJ_RULE:
- ret = cache_update(ctx->nf_sock, ctx->cache, cmd->op,
- ctx->msgs);
- if (ret < 0)
- return ret;
handle_merge(&cmd->rule->handle, &cmd->handle);
return rule_evaluate(ctx, cmd->rule);
case CMD_OBJ_CHAIN:
@@ -2983,11 +2979,6 @@ static int cmd_evaluate_add(struct eval_ctx *ctx, struct cmd *cmd)
case CMD_OBJ_COUNTER:
case CMD_OBJ_QUOTA:
case CMD_OBJ_CT_HELPER:
- ret = cache_update(ctx->nf_sock, ctx->cache, cmd->op,
- ctx->msgs);
- if (ret < 0)
- return ret;
-
return 0;
default:
BUG("invalid command object type %u\n", cmd->obj);