summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2022-12-22 11:23:00 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2022-12-22 13:05:00 +0100
commit0fe79458cb5ae36d838f0e5a5dc5cc6f332cac03 (patch)
tree72d5088569272013d80f2dd4b79974cfee288fa8 /tests
parentf0f9cd656c005ba9a17cd3cef5769c285064b202 (diff)
evaluate: fix shift exponent underflow in concatenation evaluation
There is an underflow of the index that iterates over the concatenation: ../include/datatype.h:292:15: runtime error: shift exponent 4294967290 is too large for 32-bit type 'unsigned int' set the datatype to invalid which is fine to evaluate a concatenation in a set/map statement. Update b8e1940aa190 ("tests: add a test case for map update from packet path with concat") so it does not need a workaround to work. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/shell/testcases/maps/dumps/typeof_maps_concat_update_0.nft2
-rwxr-xr-xtests/shell/testcases/maps/typeof_maps_concat_update_04
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/shell/testcases/maps/dumps/typeof_maps_concat_update_0.nft b/tests/shell/testcases/maps/dumps/typeof_maps_concat_update_0.nft
index d91b795f..a2c3c139 100644
--- a/tests/shell/testcases/maps/dumps/typeof_maps_concat_update_0.nft
+++ b/tests/shell/testcases/maps/dumps/typeof_maps_concat_update_0.nft
@@ -1,6 +1,6 @@
table ip foo {
map pinned {
- typeof ip daddr . tcp dport : ip daddr . tcp dport
+ typeof ip saddr . ct original proto-dst : ip daddr . tcp dport
size 65535
flags dynamic,timeout
timeout 6m
diff --git a/tests/shell/testcases/maps/typeof_maps_concat_update_0 b/tests/shell/testcases/maps/typeof_maps_concat_update_0
index 645ae142..e996f14e 100755
--- a/tests/shell/testcases/maps/typeof_maps_concat_update_0
+++ b/tests/shell/testcases/maps/typeof_maps_concat_update_0
@@ -4,13 +4,13 @@
EXPECTED="table ip foo {
map pinned {
- typeof ip daddr . tcp dport : ip daddr . tcp dport
+ typeof ip saddr . ct original proto-dst : ip daddr . tcp dport
size 65535
flags dynamic,timeout
timeout 6m
}
chain pr {
- meta l4proto tcp update @pinned { ip saddr . ct original proto-dst timeout 1m30s : ip daddr . tcp dport }
+ update @pinned { ip saddr . ct original proto-dst timeout 1m30s : ip daddr . tcp dport }
}
}"