summaryrefslogtreecommitdiff
path: root/lib/Vyatta/Qos/Util.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Vyatta/Qos/Util.pm')
-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 };