summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/VyattaQosTrafficLimiter.pm25
1 files changed, 1 insertions, 24 deletions
diff --git a/scripts/VyattaQosTrafficLimiter.pm b/scripts/VyattaQosTrafficLimiter.pm
index 4ffee85..45e744e 100644
--- a/scripts/VyattaQosTrafficLimiter.pm
+++ b/scripts/VyattaQosTrafficLimiter.pm
@@ -48,7 +48,7 @@
my $level = $config->setLevel();
my @matches = ();
- $self->{rate} = $config->returnValue("bandwidth");
+ $self->{rate} = VyattaQosUtil::getRate($config->returnValue("bandwidth"));
defined $self->{rate} or die "$level bandwidth not defined\n";
$self->{priority} = $config->returnValue("priority");
@@ -66,29 +66,6 @@
return @$matches;
}
- sub _getPercentRate {
- my ( $rate, $speed ) = @_;
-
- if ( !defined $rate ) {
- return; # leave rate undef
- }
-
- # Rate might be a percentage of speed
- if ( $rate =~ /%$/ ) {
- my $percent = substr( $rate, 0, length($rate) - 1 );
- if ( $percent < 0 || $percent > 100 ) {
- die "Invalid percentage bandwidth: $percent\n";
- }
-
- $rate = ( $percent * $speed ) / 100.;
- }
- else {
- $rate = VyattaQosUtil::getRate($rate);
- }
-
- return $rate;
- }
-
}
package VyattaQosTrafficLimiter;