summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2010-03-05 11:24:33 -0800
committerStig Thormodsrud <stig@vyatta.com>2010-03-05 11:24:33 -0800
commit31a37e48a3095c64aca1a3fd3a0f46ca115dc767 (patch)
tree2ac8a471f3014a7e52030b037b28934eacc448df /scripts
parent175dee3f55a177df91a896071510bcf39d23f3d0 (diff)
downloadvyatta-cfg-firewall-31a37e48a3095c64aca1a3fd3a0f46ca115dc767.tar.gz
vyatta-cfg-firewall-31a37e48a3095c64aca1a3fd3a0f46ca115dc767.zip
Fix firewall conntrack teardown.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/firewall/vyatta-firewall.pl14
1 files changed, 8 insertions, 6 deletions
diff --git a/scripts/firewall/vyatta-firewall.pl b/scripts/firewall/vyatta-firewall.pl
index 95c0198..1961541 100755
--- a/scripts/firewall/vyatta-firewall.pl
+++ b/scripts/firewall/vyatta-firewall.pl
@@ -179,13 +179,15 @@ if (defined $teardown) {
# remove the conntrack setup.
my $num;
- $num = find_chain_rule($iptables_cmd, 'raw', 'PREROUTING', 'FW_CONNTRACK');
- if (defined $num and ! is_tree_in_use($other_tree{$teardown})) {
- run_cmd("$iptables_cmd -t raw -D PREROUTING $num", 1, 1);
- run_cmd("$iptables_cmd -t raw -D OUTPUT $num", 1, 1);
- run_cmd("$iptables_cmd -t raw -F FW_CONNTRACK", 1, 1);
- run_cmd("$iptables_cmd -t raw -X FW_CONNTRACK", 1, 1);
+ foreach my $label ('PREROUTING', 'OUTPUT') {
+ $num = find_chain_rule($iptables_cmd, 'raw', $label, 'FW_CONNTRACK');
+ if (defined $num and ! is_tree_in_use($other_tree{$teardown})) {
+ run_cmd("$iptables_cmd -t raw -D $label $num", 1, 1);
+ }
}
+ run_cmd("$iptables_cmd -t raw -F FW_CONNTRACK", 1, 1);
+ run_cmd("$iptables_cmd -t raw -X FW_CONNTRACK", 1, 1);
+
exit 0;
}