summaryrefslogtreecommitdiffstats
path: root/iptables/tests/shell/testcases/ipt-restore/0012-dash-F_0
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2020-04-21 14:10:53 +0200
committerPhil Sutter <phil@nwl.cc>2020-04-23 12:54:57 +0200
commitf2ace0cdf25a5911ac84015829d65d6050a5e82d (patch)
treeae57eeb3564a38d8ca4902ac99261ce3dfa3d700 /iptables/tests/shell/testcases/ipt-restore/0012-dash-F_0
parent4e0ad5ebf077ad5745d7dec74bfbaa92c3a34b58 (diff)
tests: shell: Test -F in dump files
While not really useful, iptables-nft-restore shouldn't segfault either. This tests the problem described in nfbz#1407. Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'iptables/tests/shell/testcases/ipt-restore/0012-dash-F_0')
-rwxr-xr-xiptables/tests/shell/testcases/ipt-restore/0012-dash-F_012
1 files changed, 12 insertions, 0 deletions
diff --git a/iptables/tests/shell/testcases/ipt-restore/0012-dash-F_0 b/iptables/tests/shell/testcases/ipt-restore/0012-dash-F_0
new file mode 100755
index 00000000..fd82afa1
--- /dev/null
+++ b/iptables/tests/shell/testcases/ipt-restore/0012-dash-F_0
@@ -0,0 +1,12 @@
+#!/bin/bash -e
+
+# make sure -F lines don't cause segfaults
+
+RULESET='*nat
+-F PREROUTING
+-A PREROUTING -j ACCEPT
+-F PREROUTING
+COMMIT'
+
+echo -e "$RULESET" | $XT_MULTI iptables-restore
+echo -e "$RULESET" | $XT_MULTI iptables-restore -n