summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/sets
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2021-12-03 17:07:54 +0100
committerFlorian Westphal <fw@strlen.de>2021-12-07 12:23:21 +0100
commit028856b3dd8c935bc53ff08434dce4728627a318 (patch)
tree3e09a353f3fefe88cce27e58b252600249629103 /tests/shell/testcases/sets
parent3a8d3fea54ce6eb922e4bb04e1acf9b995a66607 (diff)
exthdr: support ip/tcp options and sctp chunks in typeof expressions
This did not store the 'op' member and listing always treated this as ipv6 extension header. Add test cases for this. Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests/shell/testcases/sets')
-rw-r--r--tests/shell/testcases/sets/dumps/typeof_sets_0.nft27
-rwxr-xr-xtests/shell/testcases/sets/typeof_sets_027
2 files changed, 54 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 06d891e6..8f11b110 100644
--- a/tests/shell/testcases/sets/dumps/typeof_sets_0.nft
+++ b/tests/shell/testcases/sets/dumps/typeof_sets_0.nft
@@ -19,6 +19,21 @@ table inet t {
elements = { 1, 1024 }
}
+ set s5 {
+ typeof ip option ra value
+ elements = { 1, 1024 }
+ }
+
+ set s6 {
+ typeof tcp option maxseg size
+ elements = { 1, 1024 }
+ }
+
+ set s7 {
+ typeof sctp chunk init num-inbound-streams
+ elements = { 1, 4 }
+ }
+
chain c1 {
osf name @s1 accept
}
@@ -26,4 +41,16 @@ table inet t {
chain c2 {
vlan id @s2 accept
}
+
+ chain c5 {
+ ip option ra value @s5 accept
+ }
+
+ chain c6 {
+ tcp option maxseg size @s6 accept
+ }
+
+ chain c7 {
+ sctp chunk init num-inbound-streams @s7 accept
+ }
}
diff --git a/tests/shell/testcases/sets/typeof_sets_0 b/tests/shell/testcases/sets/typeof_sets_0
index a6ff8ca7..1e99e298 100755
--- a/tests/shell/testcases/sets/typeof_sets_0
+++ b/tests/shell/testcases/sets/typeof_sets_0
@@ -25,6 +25,21 @@ EXPECTED="table inet t {
elements = { 1, 1024 }
}
+ set s5 {
+ typeof ip option ra value
+ elements = { 1, 1024 }
+ }
+
+ set s6 {
+ typeof tcp option maxseg size
+ elements = { 1, 1024 }
+ }
+
+ set s7 {
+ typeof sctp chunk init num-inbound-streams
+ elements = { 1, 4 }
+ }
+
chain c1 {
osf name @s1 accept
}
@@ -32,6 +47,18 @@ EXPECTED="table inet t {
chain c2 {
ether type vlan vlan id @s2 accept
}
+
+ chain c5 {
+ ip option ra value @s5 accept
+ }
+
+ chain c6 {
+ tcp option maxseg size @s6 accept
+ }
+
+ chain c7 {
+ sctp chunk init num-inbound-streams @s7 accept
+ }
}"
set -e