From 5bd6b4981ce649b5e0ae5ec30b7738ef33ef7c6e Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 30 Jun 2023 09:42:11 +0200 Subject: 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 --- tests/shell/testcases/maps/0017_map_variable_0 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 tests/shell/testcases/maps/0017_map_variable_0 (limited to 'tests/shell/testcases/maps/0017_map_variable_0') 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" -- cgit v1.2.3