From 8c42ead95f12c0c4527fc55a0ce7392757328d53 Mon Sep 17 00:00:00 2001 From: Stig Thormodsrud Date: Mon, 29 Nov 2010 17:26:47 -0800 Subject: 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. --- lib/Vyatta/IpTables/Mgr.pm | 7 +++++-- 1 file 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"); -- cgit v1.2.3