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 <[email protected]>
---

 v3: Created on v3.

 src/evaluate.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/evaluate.c b/src/evaluate.c
index dab7cfc..ed41bd8 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);
        }
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to