summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2011-10-10 15:34:45 -0700
committerStephen Hemminger <shemminger@vyatta.com>2011-10-10 15:34:45 -0700
commitebb526a9cee80127c785ad0cf97d8a5527b0420e (patch)
treed18062a3d8321a31e95e3e016f8f070b586361fb /lib
parent9591eb4cea8e60097419859d6298efd885b45892 (diff)
downloadvyatta-cfg-qos-ebb526a9cee80127c785ad0cf97d8a5527b0420e.tar.gz
vyatta-cfg-qos-ebb526a9cee80127c785ad0cf97d8a5527b0420e.zip
zero is not a legal bandwidth value
Bug 7547 Kernel limiters don't allow value of zero for bandwidth, so block it in Vyatta config.
Diffstat (limited to 'lib')
-rw-r--r--lib/Vyatta/Qos/Util.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Vyatta/Qos/Util.pm b/lib/Vyatta/Qos/Util.pm
index 6230a1d..3330c3e 100644
--- a/lib/Vyatta/Qos/Util.pm
+++ b/lib/Vyatta/Qos/Util.pm
@@ -93,8 +93,12 @@ sub getRate {
my ( $num, $suffix ) = get_num($rate);
defined $num
or die "$rate is not a valid bandwidth (not a number)\n";
- ( $num >= 0 )
- or die "$rate is not a valid bandwidth (negative value)\n";
+
+ die "Bandwidth of zero is not allowed\n"
+ if ($num == 0);
+
+ die "$rate is not a valid bandwidth (negative value)\n"
+ if ($rate < 0);
if ( defined $suffix ) {
my $scale = $rates{ lc $suffix };