summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/optimizations
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2022-01-02 21:53:41 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2022-01-15 18:11:22 +0100
commit1542082e259b4a9270e0726904796730a5c310d6 (patch)
treef9bc71ca8253048989e2d0da5022b99127e765aa /tests/shell/testcases/optimizations
parent8b4c95dae6c19eb29fb4ad5e931b67097851f0f1 (diff)
optimize: merge same selector with different verdict into verdict map
Transform: ct state invalid drop ct state established,related accept into: ct state vmap { established : accept, related : accept, invalid : drop } Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/shell/testcases/optimizations')
-rw-r--r--tests/shell/testcases/optimizations/dumps/merge_stmts_vmap.nft5
-rwxr-xr-xtests/shell/testcases/optimizations/merge_stmts_vmap12
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/shell/testcases/optimizations/dumps/merge_stmts_vmap.nft b/tests/shell/testcases/optimizations/dumps/merge_stmts_vmap.nft
new file mode 100644
index 00000000..9fa19afc
--- /dev/null
+++ b/tests/shell/testcases/optimizations/dumps/merge_stmts_vmap.nft
@@ -0,0 +1,5 @@
+table ip x {
+ chain y {
+ ct state vmap { invalid : drop, established : accept, related : accept }
+ }
+}
diff --git a/tests/shell/testcases/optimizations/merge_stmts_vmap b/tests/shell/testcases/optimizations/merge_stmts_vmap
new file mode 100755
index 00000000..f838fcfe
--- /dev/null
+++ b/tests/shell/testcases/optimizations/merge_stmts_vmap
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+set -e
+
+RULESET="table ip x {
+ chain y {
+ ct state invalid drop
+ ct state established,related accept
+ }
+}"
+
+$NFT -o -f - <<< $RULESET