summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2010-06-12 15:19:49 -0700
committerStig Thormodsrud <stig@vyatta.com>2010-06-12 15:19:49 -0700
commit0ef8524ab2596e221555a9947446eaa5cefd497e (patch)
treee115f3d27fb5363a52c58e7070e4aa22255194f7 /scripts
parent7175b3045005170bbc946c63a97acda4c24debb8 (diff)
downloadvyatta-cfg-firewall-0ef8524ab2596e221555a9947446eaa5cefd497e.tar.gz
vyatta-cfg-firewall-0ef8524ab2596e221555a9947446eaa5cefd497e.zip
Dont create FW_CONNTRACK if it already exists.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/firewall/vyatta-firewall.pl9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/firewall/vyatta-firewall.pl b/scripts/firewall/vyatta-firewall.pl
index b09d159..eb115a6 100755
--- a/scripts/firewall/vyatta-firewall.pl
+++ b/scripts/firewall/vyatta-firewall.pl
@@ -695,8 +695,13 @@ sub setup_iptables {
}
# by default, nothing is tracked (the last rule in raw/PREROUTING).
- ipt_enable_conntrack($iptables_cmd, 'FW_CONNTRACK');
- disable_fw_conntrack($iptables_cmd);
+ my $cnt = count_iptables_rules('raw', 'FW_CONNTRACK', $iptables_cmd);
+ if ($cnt == 0) {
+ ipt_enable_conntrack($iptables_cmd, 'FW_CONNTRACK');
+ disable_fw_conntrack($iptables_cmd);
+ } else {
+ log_msg "FW_CONNTRACK exists $cnt\n";
+ }
return 0;
}