diff options
author | Alvaro Neira Ayuso <alvaroneay@gmail.com> | 2014-09-17 09:20:28 +0200 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2014-09-17 09:20:28 +0200 |
commit | d4e06f5bb9511c6a3a00191f74a99ba0c58093a6 (patch) | |
tree | 742db55dd46f7c809b20b00fa02095a1ce078163 /src/payload.c | |
parent | 52f169d3938492e42112e0412e17780db7949227 (diff) |
src: add specific byteorder to the struct proto_hdr_template
If we try to add a rule like:
nft add rule filter input udp length {55-9999}
nftable shows:
BUG: invalid byte order conversion 0 => 2
nft: src/evaluate.c:153: byteorder_conversion_op: Assertion `0' failed.
Some of the existing payload fields rely on BYTEORDER_INVALID. Therefore, if we
try to convert it in evaluation step, we hit this bug.
This patch allows to add a specific byteorder to the struct proto_hdr_template. If
we create a expression with a invalid byteorder, we will use the byteorder
added to the proto_hdr_template structure.
Signed-off-by: Alvaro Neira Ayuso <alvaroneay@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'src/payload.c')
-rw-r--r-- | src/payload.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/payload.c b/src/payload.c index 88baef20..1eee4e09 100644 --- a/src/payload.c +++ b/src/payload.c @@ -117,7 +117,7 @@ struct expr *payload_expr_alloc(const struct location *loc, } expr = expr_alloc(loc, &payload_expr_ops, tmpl->dtype, - tmpl->dtype->byteorder, tmpl->len); + tmpl->byteorder, tmpl->len); expr->flags |= flags; expr->payload.desc = desc; |