summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2020-04-01 16:02:16 +0200
committerFlorian Westphal <fw@strlen.de>2020-04-01 16:43:29 +0200
commit4ff24ab735c80136c9ce2cca4c3b95065369081d (patch)
treee515ca79a054df141a07ef973dcd99a091519c7c /tests/shell/testcases
parentaa2ddbfbee904445b3593082455056ba3fed321c (diff)
concat: provide proper dtype when parsing typeof udata
Pablo reports following list bug: table ip foo { map whitelist { typeof ip saddr . ip daddr : meta mark elements = { 0x0 [invalid type] . 0x0 [invalid type] : 0x00000001, 0x0 [invalid type] . 0x0 [invalid type] : 0x00000002 } } } Problem is that concat provided 'invalid' dtype. Reported-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests/shell/testcases')
-rw-r--r--tests/shell/testcases/maps/dumps/typeof_maps_0.nft7
-rwxr-xr-xtests/shell/testcases/maps/typeof_maps_07
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/shell/testcases/maps/dumps/typeof_maps_0.nft b/tests/shell/testcases/maps/dumps/typeof_maps_0.nft
index 4361ca3d..faa73cd1 100644
--- a/tests/shell/testcases/maps/dumps/typeof_maps_0.nft
+++ b/tests/shell/testcases/maps/dumps/typeof_maps_0.nft
@@ -9,8 +9,15 @@ table inet t {
elements = { 1 : 0x00000001, 4095 : 0x00004095 }
}
+ map m3 {
+ typeof ip saddr . ip daddr : meta mark
+ elements = { 1.2.3.4 . 5.6.7.8 : 0x00000001,
+ 2.3.4.5 . 6.7.8.9 : 0x00000002 }
+ }
+
chain c {
ct mark set osf name map @m1
meta mark set vlan id map @m2
+ meta mark set ip saddr . ip daddr map @m3
}
}
diff --git a/tests/shell/testcases/maps/typeof_maps_0 b/tests/shell/testcases/maps/typeof_maps_0
index 950bbf1c..e1c4bba9 100755
--- a/tests/shell/testcases/maps/typeof_maps_0
+++ b/tests/shell/testcases/maps/typeof_maps_0
@@ -16,9 +16,16 @@ EXPECTED="table inet t {
4095 : 0x4095 }
}
+ map m3 {
+ typeof ip saddr . ip daddr : meta mark
+ elements = { 1.2.3.4 . 5.6.7.8 : 0x00000001,
+ 2.3.4.5 . 6.7.8.9 : 0x00000002 }
+ }
+
chain c {
ct mark set osf name map @m1
ether type vlan meta mark set vlan id map @m2
+ meta mark set ip saddr . ip daddr map @m3
}
}"