From: Phil Sutter Date: Fri, 7 Jun 2019 17:21:17 +0000 (+0200) Subject: cache: Fix evaluation for rules with index reference X-Git-Tag: v0.9.1~37 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9f5c65f72fd8b357b6d9e504fa3d9e8edcfa67a0;p=thirdparty%2Fnftables.git cache: Fix evaluation for rules with index reference 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 Signed-off-by: Pablo Neira Ayuso --- diff --git a/src/cache.c b/src/cache.c index 2a0f04d1..532ef425 100644 --- a/src/cache.c +++ b/src/cache.c @@ -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: