37 lines
1.2 KiB
Diff
37 lines
1.2 KiB
Diff
From d5525024223f324c71edb9135f1938745d45acee Mon Sep 17 00:00:00 2001
|
|
From: Florian Westphal <fw@strlen.de>
|
|
Date: Wed, 3 Feb 2021 17:57:06 +0100
|
|
Subject: [PATCH] evaluate: pick data element byte order, not dtype one
|
|
|
|
Some expressions have integer base type, not a specific one, e.g. 'ct zone'.
|
|
In that case nft used the wrong byte order.
|
|
|
|
Without this, nft adds
|
|
elements = { "eth0" : 256, "eth1" : 512, "veth4" : 256 }
|
|
instead of 1, 2, 3.
|
|
|
|
This is not a 'display bug', the added elements have wrong byte order.
|
|
|
|
Signed-off-by: Florian Westphal <fw@strlen.de>
|
|
(cherry picked from commit 84b1d078e86dea25c93e15c3e5a3160bbf77e4e7)
|
|
---
|
|
src/evaluate.c | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/src/evaluate.c b/src/evaluate.c
|
|
index 73d6fd0e89bc2..0543190fe777a 100644
|
|
--- a/src/evaluate.c
|
|
+++ b/src/evaluate.c
|
|
@@ -1583,7 +1583,7 @@ static int expr_evaluate_mapping(struct eval_ctx *ctx, struct expr **expr)
|
|
else
|
|
datalen = set->data->len;
|
|
|
|
- expr_set_context(&ctx->ectx, set->data->dtype, datalen);
|
|
+ __expr_set_context(&ctx->ectx, set->data->dtype, set->data->byteorder, datalen, 0);
|
|
} else {
|
|
assert((set->flags & NFT_SET_MAP) == 0);
|
|
}
|
|
--
|
|
2.34.1
|
|
|