diff options
author | Gaurav <gaurav.sinha@vyatta.com> | 2012-02-24 11:22:41 -0800 |
---|---|---|
committer | Gaurav Sinha <gaurav.sinha@vyatta.com> | 2012-03-16 16:43:55 -0700 |
commit | 516e4988be28dd2441e915fe7d4c6a2efb5bd0c6 (patch) | |
tree | 6cd4d96bce9a2914e4306f96834ff216e6c97796 /lib/Vyatta | |
parent | d3296d0d9376a67983871736e74409fabfc20634 (diff) | |
download | vyatta-conntrack-516e4988be28dd2441e915fe7d4c6a2efb5bd0c6.tar.gz vyatta-conntrack-516e4988be28dd2441e915fe7d4c6a2efb5bd0c6.zip |
Adding deletion, error handling etc.
(cherry picked from commit 6a59a800acf9a9f6a21677e6187a33647ceb3539)
Diffstat (limited to 'lib/Vyatta')
-rw-r--r-- | lib/Vyatta/Conntrack/RuleCT.pm | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/Vyatta/Conntrack/RuleCT.pm b/lib/Vyatta/Conntrack/RuleCT.pm index 421b746..d2c6409 100644 --- a/lib/Vyatta/Conntrack/RuleCT.pm +++ b/lib/Vyatta/Conntrack/RuleCT.pm @@ -11,7 +11,7 @@ require Vyatta::IpTables::AddressFilter; my $src = new Vyatta::IpTables::AddressFilter; my $dst = new Vyatta::IpTables::AddressFilter; - +my $CTERROR = "Conntrack Timeout Error:"; my %fields = ( _rule_number => undef, _protocol => undef, @@ -66,11 +66,17 @@ sub rule { my @level_nodes = split (' ', $self->{_comment}); $rule .= "-m comment --comment \"$level_nodes[2]-$level_nodes[5]\" "; ($srcrule, $err_str) = $src->rule(); - return ($err_str, ) if (!defined($srcrule)); + if (defined($err_str)) { + Vyatta::Config::outputError(["Conntrack"], "Conntrack config error: $err_str"); + exit 1; + } ($dstrule, $err_str) = $dst->rule(); - return ($err_str, ) if (!defined($dstrule)); + if (defined($err_str)) { + Vyatta::Config::outputError(["Conntrack"], "Conntrack config error: $err_str"); + exit 1; + } $rule .= " $srcrule $dstrule "; - print "rule is $rule\n"; + return $rule; } sub new { |