diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2011-10-10 15:34:45 -0700 |
---|---|---|
committer | Stephen Hemminger <shemminger@vyatta.com> | 2011-10-10 15:34:45 -0700 |
commit | ebb526a9cee80127c785ad0cf97d8a5527b0420e (patch) | |
tree | d18062a3d8321a31e95e3e016f8f070b586361fb /lib | |
parent | 9591eb4cea8e60097419859d6298efd885b45892 (diff) | |
download | vyatta-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.pm | 8 |
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 }; |