]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
tests: shell: Test ebtables-restore deleting among matches
authorPhil Sutter <phil@nwl.cc>
Tue, 5 Nov 2024 16:17:01 +0000 (17:17 +0100)
committerPhil Sutter <phil@nwl.cc>
Tue, 5 Nov 2024 22:58:03 +0000 (23:58 +0100)
Rules containing among match would spuriously fail to compare if there
was a previous rule with larger among match payload.

Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables/tests/shell/testcases/ebtables/0012-restore-delete-among_0 [new file with mode: 0755]

diff --git a/iptables/tests/shell/testcases/ebtables/0012-restore-delete-among_0 b/iptables/tests/shell/testcases/ebtables/0012-restore-delete-among_0
new file mode 100755 (executable)
index 0000000..165745e
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/bash -e
+
+case "$XT_MULTI" in
+*xtables-nft-multi)
+       ;;
+*)
+       echo "skip $XT_MULTI"
+       exit 0
+       ;;
+esac
+
+RULESET='*filter
+-A FORWARD --among-dst de:ad:0:be:ee:ff,c0:ff:ee:0:ba:be
+-A FORWARD --among-dst de:ad:0:be:ee:ff'
+
+$XT_MULTI ebtables-restore <<< "$RULESET"
+echo "$RULESET" | sed -e 's/-A/-D/' | $XT_MULTI ebtables-restore --noflush
+