diff options
author | Florian Westphal <fw@strlen.de> | 2015-08-07 12:09:08 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2015-09-18 00:06:49 +0200 |
commit | 39f15c243912a20f3014c0efba6b8dbc80caf0e9 (patch) | |
tree | f0724240418d2c93175669bb575913edc8630b3c /src/evaluate.c | |
parent | e540acb8c1e16c9a9afc4c800ce524e47be803d4 (diff) |
nft: support listing expressions that use non-byte header fields
This allows to list rules that check fields that are not aligned on byte
boundary.
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'src/evaluate.c')
-rw-r--r-- | src/evaluate.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/evaluate.c b/src/evaluate.c index 95469180..581f3641 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -310,8 +310,13 @@ static bool resolve_protocol_conflict(struct eval_ctx *ctx, const struct proto_desc *next = ctx->pctx.protocol[base + 1].desc; if (payload->payload.desc == next) { + ctx->pctx.protocol[base + 1].desc = NULL; + ctx->pctx.protocol[base].desc = next; + ctx->pctx.protocol[base].offset += desc->length; payload->payload.offset += desc->length; return true; + } else if (next) { + return false; } } @@ -321,6 +326,7 @@ static bool resolve_protocol_conflict(struct eval_ctx *ctx, payload->payload.offset += ctx->pctx.protocol[base].offset; list_add_tail(&nstmt->list, &ctx->stmt->list); + ctx->pctx.protocol[base + 1].desc = NULL; return true; } |