summaryrefslogtreecommitdiffstats
path: root/src/evaluate.c
diff options
context:
space:
mode:
authorElise Lennion <elise.lennion@gmail.com>2017-01-26 15:14:30 -0200
committerPablo Neira Ayuso <pablo@netfilter.org>2017-01-27 13:33:20 +0100
commit1b5dc09f718ee27b95cc1153599cd72b2076929c (patch)
tree89e8cc728e21a3bc50e141fd3a4a0984cab74ab9 /src/evaluate.c
parente1ec60b3aa99835d3bd2982f31bb15d4b915b032 (diff)
evaluate: Evaluate table name before reset stateful objects in a table
Reseting stateful objects in a single table is already implemented and cmd_evaluate_reset() now tests for the table name. Signed-off-by: Elise Lennion <elise.lennion@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/evaluate.c')
-rw-r--r--src/evaluate.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/evaluate.c b/src/evaluate.c
index dab7cfca..ed41bd8a 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -2974,13 +2974,14 @@ static int cmd_evaluate_reset(struct eval_ctx *ctx, struct cmd *cmd)
switch (cmd->obj) {
case CMD_OBJ_COUNTER:
case CMD_OBJ_QUOTA:
+ case CMD_OBJ_COUNTERS:
+ case CMD_OBJ_QUOTAS:
+ if (cmd->handle.table == NULL)
+ return 0;
if (table_lookup(&cmd->handle) == NULL)
return cmd_error(ctx, "Could not process rule: Table '%s' does not exist",
cmd->handle.table);
return 0;
- case CMD_OBJ_COUNTERS:
- case CMD_OBJ_QUOTAS:
- return 0;
default:
BUG("invalid command object type %u\n", cmd->obj);
}