diff options
author | Stig Thormodsrud <stig@vyatta.com> | 2010-11-29 17:26:47 -0800 |
---|---|---|
committer | Stig Thormodsrud <stig@vyatta.com> | 2010-11-29 17:26:47 -0800 |
commit | 8c42ead95f12c0c4527fc55a0ce7392757328d53 (patch) | |
tree | d4559a876f9fd7a749bcfe7e3b4dbf58c55b58f7 | |
parent | 8c4804927b8f2d14223648cd238a639bf6aa7237 (diff) | |
download | vyatta-cfg-firewall-8c42ead95f12c0c4527fc55a0ce7392757328d53.tar.gz vyatta-cfg-firewall-8c42ead95f12c0c4527fc55a0ce7392757328d53.zip |
Fix 6442: Request to remove "Error: ipt_disable_conntrack failed to find
Don't print scary messages when trying to delete something thats not there.
-rwxr-xr-x | lib/Vyatta/IpTables/Mgr.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Vyatta/IpTables/Mgr.pm b/lib/Vyatta/IpTables/Mgr.pm index 5b3c9b4..d14d9c5 100755 --- a/lib/Vyatta/IpTables/Mgr.pm +++ b/lib/Vyatta/IpTables/Mgr.pm @@ -32,6 +32,7 @@ our @EXPORT = qw(ipt_find_chain_rule ipt_enable_conntrack ipt_disable_conntrack count_iptables_rules chain_referenced ipt_get_queue_target); +my $debug = 0; sub ipt_find_chain_rule { my ($iptables_cmd, $table, $chain, $search) = @_; @@ -93,8 +94,10 @@ sub ipt_disable_conntrack { $index = ipt_find_chain_rule($iptables_cmd, 'raw', $label, $chain); if (! defined($index)) { - print "Error: ipt_disable_conntrack failed to find " - . "[$label][$chain]\n"; + if ($debug > 0) { + print "Error: ipt_disable_conntrack failed to find " + . "[$label][$chain]\n"; + } return 1; } system("sudo $iptables_cmd -t raw -D $label $index"); |