summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/sets
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2020-04-29 12:10:07 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2020-04-29 12:31:04 +0200
commit12467ee9379ee16cf0e9a943ded8054710097134 (patch)
tree400bbc11fada5ae53f465a88016b97adec22a35a /tests/shell/testcases/sets
parent6a8668b1fded4fbc908a35ee2b49a2d0b70a1a24 (diff)
evaluate: incorrect byteorder with typeof and integer_datatype
table bridge t { set s3 { typeof meta ibrpvid elements = { 2, 3, 103 } } } # nft --debug=netlink -f test.nft s3 t 0 s3 t 0 element 00000100 : 0 [end] element 00000200 : 0 [end] element 00000300 : 0 [end] ^^^^^^^^ The integer_type uses BYTEORDER_INVALID byteorder (which is implicitly handled as BYTEORDER_BIG_ENDIAN). Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/shell/testcases/sets')
-rw-r--r--tests/shell/testcases/sets/dumps/typeof_sets_0.nft5
-rwxr-xr-xtests/shell/testcases/sets/typeof_sets_05
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/shell/testcases/sets/dumps/typeof_sets_0.nft b/tests/shell/testcases/sets/dumps/typeof_sets_0.nft
index 44e11202..565369fb 100644
--- a/tests/shell/testcases/sets/dumps/typeof_sets_0.nft
+++ b/tests/shell/testcases/sets/dumps/typeof_sets_0.nft
@@ -9,6 +9,11 @@ table inet t {
elements = { 2, 3, 103 }
}
+ set s3 {
+ typeof meta ibrpvid
+ elements = { 2, 3, 103 }
+ }
+
chain c1 {
osf name @s1 accept
}
diff --git a/tests/shell/testcases/sets/typeof_sets_0 b/tests/shell/testcases/sets/typeof_sets_0
index 2a8b21c7..9b2712e5 100755
--- a/tests/shell/testcases/sets/typeof_sets_0
+++ b/tests/shell/testcases/sets/typeof_sets_0
@@ -15,6 +15,11 @@ EXPECTED="table inet t {
elements = { 2, 3, 103 }
}
+ set s3 {
+ typeof meta ibrpvid
+ elements = { 2, 3, 103 }
+ }
+
chain c1 {
osf name @s1 accept
}