summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaurav <gaurav.sinha@vyatta.com>2012-02-27 13:32:49 -0800
committerGaurav Sinha <gaurav.sinha@vyatta.com>2012-03-16 16:46:37 -0700
commit0ce737072a77c6e173df223722b023f529bfb00d (patch)
tree75b7a82939ac250097093af5a092dc6768bdc9d8
parent86524b38252bfcc4f143247947adbd280d98a222 (diff)
downloadvyatta-conntrack-0ce737072a77c6e173df223722b023f529bfb00d.tar.gz
vyatta-conntrack-0ce737072a77c6e173df223722b023f529bfb00d.zip
check presence of protocol config subtree
(cherry picked from commit 54ca4cdaa0c665763f6d14d94c3ef16fbdf014ed)
-rw-r--r--scripts/vyatta-conntrack-timeouts.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/vyatta-conntrack-timeouts.pl b/scripts/vyatta-conntrack-timeouts.pl
index ce115e0..f1aa790 100644
--- a/scripts/vyatta-conntrack-timeouts.pl
+++ b/scripts/vyatta-conntrack-timeouts.pl
@@ -136,8 +136,8 @@ sub do_protocol_check {
my ($rule) = @_;
my $config = new Vyatta::Config;
my $protocol_nos = $config->listNodes("system conntrack timeout custom rule $rule protocol");
- if ($protocol_nos > 1) {
- Vyatta::Config::outputError(["Conntrack"], "Conntrack config error: more than one protocol in rule $rule");
+ if (($protocol_nos > 1) or ($protocol_nos < 1)) {
+ Vyatta::Config::outputError(["Conntrack"], "Conntrack config error: please configure exactly one protocol in rule $rule");
exit 1;
}
}