summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-07-20 15:13:58 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-07-20 15:16:49 -0700
commitd05887ea055bec73773f71edec4f88491b0b9043 (patch)
tree80a080b779c1869ea14550df97548a4361a1d4be
parent71b9bb01926ee220b73fb3135c5e7f5de9c80023 (diff)
downloadvyatta-cfg-qos-d05887ea055bec73773f71edec4f88491b0b9043.tar.gz
vyatta-cfg-qos-d05887ea055bec73773f71edec4f88491b0b9043.zip
Fix random-detect queue to small message
Give correct message when queue limit too small in random detect
-rw-r--r--lib/Vyatta/Qos/ShaperClass.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Vyatta/Qos/ShaperClass.pm b/lib/Vyatta/Qos/ShaperClass.pm
index 464c58d..a495863 100644
--- a/lib/Vyatta/Qos/ShaperClass.pm
+++ b/lib/Vyatta/Qos/ShaperClass.pm
@@ -173,13 +173,13 @@ sub redQdisc {
sub redValidate {
my ( $self, $level, $rate ) = @_;
my $limit = $self->{_limit};
- my $qmax = redQsize($rate);
+ my $qmax = int((redQsize($rate) + AVGPKT - 1) / AVGPKT);
- if ( defined($limit) && $limit * AVGPKT < $qmax ) {
+ if ( defined($limit) && $limit < $qmax ) {
print STDERR "Configuration error in: $level\n";
printf STDERR
-"The queue limit (%d) is too small, must be greater than %d when using random-detect\n",
- $level, $qmax / AVGPKT;
+"The queue limit (%d) is too small, must be %d or more when using random-detect\n",
+ $limit, $qmax;
exit 1;
}