From: Pablo Neira Ayuso Date: Thu, 28 Jan 2016 11:52:47 +0000 (+0100) Subject: evaluate: don't adjust offset from resolve_protocol_conflict() X-Git-Tag: v0.6~129 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fc929814bd553d3de339ea1364e87807ce1475fe;p=thirdparty%2Fnftables.git evaluate: don't adjust offset from resolve_protocol_conflict() This is not itself a conflict, move this check out of this function. Signed-off-by: Pablo Neira Ayuso --- diff --git a/src/evaluate.c b/src/evaluate.c index a294070a..5ef035be 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -395,11 +395,6 @@ static int resolve_protocol_conflict(struct eval_ctx *ctx, struct stmt *nstmt = NULL; int link, err; - if (desc == payload->payload.desc) { - payload->payload.offset += ctx->pctx.protocol[base].offset; - return 0; - } - err = supersede_dep(ctx, desc, payload); if (err <= 0) return err; @@ -448,6 +443,14 @@ static int __expr_evaluate_payload(struct eval_ctx *ctx, struct expr *expr) return -1; list_add_tail(&nstmt->list, &ctx->stmt->list); } else { + /* No conflict: Same payload protocol as context, adjust offset + * if needed. + */ + if (desc == payload->payload.desc) { + payload->payload.offset += + ctx->pctx.protocol[base].offset; + return 0; + } /* If we already have context and this payload is on the same * base, try to resolve the protocol conflict. */