summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMichael Braun <michael-dev@fami-braun.de>2022-07-28 11:36:44 +0200
committerFlorian Westphal <fw@strlen.de>2022-08-11 08:03:54 +0200
commitbe7be3995a769ae53568a86ba0b6e5469789cec1 (patch)
tree83bc0adbfe7807b5cf17dd13a5668a0018fc3b34 /tests
parent132486709b1194c9f4ff721db8d5873838965548 (diff)
concat with dynamically sized fields like vlan id
This enables commands like nft set bridge t s4 '{typeof vlan id . ip daddr; elements = { 3567 . 1.2.3.4 }; }' Which would previously fail with Error: can not use variable sized data types (integer) in concat expressions Signed-off-by: Michael Braun <michael-dev@fami-braun.de> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests')
-rw-r--r--tests/shell/testcases/sets/dumps/typeof_sets_0.nft9
-rwxr-xr-xtests/shell/testcases/sets/typeof_sets_09
2 files changed, 18 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 68b4dcc5..6f5b83af 100644
--- a/tests/shell/testcases/sets/dumps/typeof_sets_0.nft
+++ b/tests/shell/testcases/sets/dumps/typeof_sets_0.nft
@@ -50,6 +50,11 @@ table inet t {
elements = { "eth0" . 10.1.1.2 . 42 }
}
+ set s11 {
+ typeof vlan id . ip saddr
+ elements = { 3567 . 1.2.3.4 }
+ }
+
chain c1 {
osf name @s1 accept
}
@@ -85,4 +90,8 @@ table inet t {
chain c10 {
iifname . ip saddr . ipsec in reqid @s10 accept
}
+
+ chain c11 {
+ vlan id . ip saddr @s11 accept
+ }
}
diff --git a/tests/shell/testcases/sets/typeof_sets_0 b/tests/shell/testcases/sets/typeof_sets_0
index 5fc6a121..9f777a8c 100755
--- a/tests/shell/testcases/sets/typeof_sets_0
+++ b/tests/shell/testcases/sets/typeof_sets_0
@@ -55,6 +55,11 @@ EXPECTED="table inet t {
elements = { \"eth0\" . 10.1.1.2 . 42 }
}
+ set s11 {
+ typeof vlan id . ip saddr
+ elements = { 3567 . 1.2.3.4 }
+ }
+
chain c1 {
osf name @s1 accept
}
@@ -90,6 +95,10 @@ EXPECTED="table inet t {
chain c10 {
meta iifname . ip saddr . ipsec in reqid @s10 accept
}
+
+ chain c11 {
+ ether type vlan vlan id . ip saddr @s11 accept
+ }
}"
set -e