summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/maps/0017_map_variable_0
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2023-06-30 09:42:11 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2023-06-30 09:43:24 +0200
commit5bd6b4981ce649b5e0ae5ec30b7738ef33ef7c6e (patch)
tree6791535a71db273cf26dfcae907f36acd5a17d3b /tests/shell/testcases/maps/0017_map_variable_0
parent50bebfaf9d558d539f06c0710781a49e8b58f25f (diff)
expression: define .clone for catchall set element
Otherwise reuse of catchall set element expression in variable triggers a null-pointer dereference. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/shell/testcases/maps/0017_map_variable_0')
-rwxr-xr-xtests/shell/testcases/maps/0017_map_variable_021
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/shell/testcases/maps/0017_map_variable_0 b/tests/shell/testcases/maps/0017_map_variable_0
new file mode 100755
index 00000000..70cea88d
--- /dev/null
+++ b/tests/shell/testcases/maps/0017_map_variable_0
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+set -e
+
+RULESET="define x = {
+ 1.1.1.1 : 2,
+ * : 3,
+}
+
+table ip x {
+ map y {
+ typeof ip saddr : mark
+ elements = \$x
+ }
+ map z {
+ typeof ip saddr : mark
+ elements = \$x
+ }
+}"
+
+$NFT -f - <<< "$RULESET"