summaryrefslogtreecommitdiffstats
path: root/iptables/tests/shell/testcases/ebtables
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2023-11-07 19:12:14 +0100
committerPhil Sutter <phil@nwl.cc>2023-11-07 23:24:12 +0100
commitc1083acea70787eea3f7929fd04718434bb05ba8 (patch)
tree558d8e814016e6ee5eafcbdee1f27d5476079d0b /iptables/tests/shell/testcases/ebtables
parent3493d40cbba9dbfc00018b419241c93646a97a68 (diff)
ebtables: Fix corner-case noflush restore bug
Report came from firwalld, but this is actually rather hard to trigger. Since a regular chain line prevents it, typical dump/restore use-cases are unaffected. Fixes: 73611d5582e72 ("ebtables-nft: add broute table emulation") Cc: Eric Garver <eric@garver.life> Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'iptables/tests/shell/testcases/ebtables')
-rwxr-xr-xiptables/tests/shell/testcases/ebtables/0009-broute-bug_025
1 files changed, 25 insertions, 0 deletions
diff --git a/iptables/tests/shell/testcases/ebtables/0009-broute-bug_0 b/iptables/tests/shell/testcases/ebtables/0009-broute-bug_0
new file mode 100755
index 00000000..0def0ac5
--- /dev/null
+++ b/iptables/tests/shell/testcases/ebtables/0009-broute-bug_0
@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# Missing BROUTING-awareness in ebt_get_current_chain() caused an odd caching bug when restoring:
+# - with --noflush
+# - a second table after the broute one
+# - A policy command but no chain line for BROUTING chain
+
+set -e
+
+case "$XT_MULTI" in
+*xtables-nft-multi)
+ ;;
+*)
+ echo "skip $XT_MULTI"
+ exit 0
+ ;;
+esac
+
+$XT_MULTI ebtables-restore --noflush <<EOF
+*broute
+-P BROUTING ACCEPT
+*nat
+-P PREROUTING ACCEPT
+COMMIT
+EOF