summaryrefslogtreecommitdiffstats
path: root/iptables/tests/shell/testcases
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2019-02-01 19:17:50 +0100
committerFlorian Westphal <fw@strlen.de>2019-02-01 19:33:59 +0100
commita880cc28358a32f96467e248266973b6ab83f080 (patch)
tree826e8ad7d441983eb1efd56fe6ce17b2a0effd8d /iptables/tests/shell/testcases
parentac8d992b8b2a23c5ae56afc428737c6863461136 (diff)
xtables: Fix for crash when comparing rules with standard target
When parsing an nftnl_rule with a standard verdict, nft_rule_to_iptables_command_state() initialized cs->target but didn't care about cs->target->t. When later comparing that rule to another, compare_targets() crashed due to unconditional access to t's fields. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'iptables/tests/shell/testcases')
-rwxr-xr-xiptables/tests/shell/testcases/iptables/0005-delete-rules_07
1 files changed, 7 insertions, 0 deletions
diff --git a/iptables/tests/shell/testcases/iptables/0005-delete-rules_0 b/iptables/tests/shell/testcases/iptables/0005-delete-rules_0
new file mode 100755
index 00000000..9312fd53
--- /dev/null
+++ b/iptables/tests/shell/testcases/iptables/0005-delete-rules_0
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+# test for crash when comparing rules with standard target
+
+$XT_MULTI iptables -A FORWARD -i eth23 -o eth42 -j DROP
+$XT_MULTI iptables -D FORWARD -i eth23 -o eth42 -j REJECT
+[[ $? -eq 1 ]] || exit 1