summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/VyattaQosTrafficShaper.pm8
-rw-r--r--scripts/VyattaQosUtil.pm5
2 files changed, 8 insertions, 5 deletions
diff --git a/scripts/VyattaQosTrafficShaper.pm b/scripts/VyattaQosTrafficShaper.pm
index 16c1fef..e051542 100644
--- a/scripts/VyattaQosTrafficShaper.pm
+++ b/scripts/VyattaQosTrafficShaper.pm
@@ -34,8 +34,8 @@
my $level = $config->setLevel();
my @matches = ();
- $self->{_rate} = $config->returnValue("rate");
- defined $self->{_rate} or die "Rate not defined for class $id\n";
+ $self->{_rate} = $config->returnValue("bandwidth");
+ defined $self->{_rate} or die "Bandwidth not defined for class $id\n";
$self->{_id} = sprintf "%04x", $id;
$self->{_priority} = $config->returnValue("priority");
@@ -79,14 +79,14 @@
my $matches = $self->{_match};
$rate <= $speed or
- die "Rate for class $id ($rate) must be less than overall rate ($speed)\n";
+ die "Bandwidth for class $id ($rate) must be less than overall bandwidth ($speed)\n";
# create the class
my $cmd ="class add dev $dev parent 1:1 classid 1:$id htb rate $rate";
if ( defined $ceil) {
$ceil >= $rate or
- die "Rate ceiling ($ceil) must be greater than base rate ($rate)\n";
+ die "Ceiling ($ceil) must be greater than bandwith ($rate)\n";
$cmd .= " ceil $ceil";
}
diff --git a/scripts/VyattaQosUtil.pm b/scripts/VyattaQosUtil.pm
index 0c9ab83..d8a5fa1 100644
--- a/scripts/VyattaQosUtil.pm
+++ b/scripts/VyattaQosUtil.pm
@@ -47,9 +47,12 @@ sub getRate {
die "Rate must be a number followed by a optional suffix (kbit, mbps, ...)\n";
}
+ } else {
+ # No suffix implies Kbps just as IOS
+ $num *= 8000;
}
- die "Negative rate not allowed\n" if ($num < 0);
+ ($num >= 0) or die "Negative rate not allowed\n";
return $num;
}