]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
cache: Fix evaluation for rules with index reference
authorPhil Sutter <phil@nwl.cc>
Fri, 7 Jun 2019 17:21:17 +0000 (19:21 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 7 Jun 2019 21:54:51 +0000 (23:54 +0200)
After parsing input, rule location data (index or handle) is contained
in cmd->handle, not yet in cmd->rule->handle.

Fixes: 7df42800cf89e ("src: single cache_update() call to build cache before evaluation")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/cache.c

index 2a0f04d12e25904213d385bf6948e22bb0a7b7da..532ef425906ad02aa56eb0c63365eace8076bde5 100644 (file)
@@ -24,13 +24,7 @@ static unsigned int evaluate_cache_add(struct cmd *cmd)
                completeness = cmd->op;
                break;
        case CMD_OBJ_RULE:
-               /* XXX index is set to zero unless this handle_merge() call is
-                * invoked, this handle_merge() call is done from the
-                * evaluation, which is too late.
-                */
-               handle_merge(&cmd->rule->handle, &cmd->handle);
-
-               if (cmd->rule->handle.index.id)
+               if (cmd->handle.index.id)
                        completeness = CMD_LIST;
                break;
        default: