From ebb526a9cee80127c785ad0cf97d8a5527b0420e Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 10 Oct 2011 15:34:45 -0700 Subject: 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. --- lib/Vyatta/Qos/Util.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib') 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 }; -- cgit v1.2.3