diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-06-10 14:25:14 -0700 |
---|---|---|
committer | Stephen Hemminger <shemminger@lenny.localdomain> | 2009-10-01 13:51:19 -0700 |
commit | 969064d17f9cc50a68e2922ec30ec5bb63b31763 (patch) | |
tree | 915d2ee0fb54b8c03be129cfd559dc0681da3ab4 /lib | |
parent | 6cf4217e392eb4c0956804b1ba66874de68fbd5e (diff) | |
download | vyatta-cfg-qos-969064d17f9cc50a68e2922ec30ec5bb63b31763.tar.gz vyatta-cfg-qos-969064d17f9cc50a68e2922ec30ec5bb63b31763.zip |
Handle round-robin without configuration of default
If default class is not configured Qos.
Bug 4529
(cherry picked from commit 0df90b28ca6d9cb6ae4f5267ef8522ac12a0c352)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Vyatta/Qos/RoundRobin.pm | 13 | ||||
-rw-r--r-- | lib/Vyatta/Qos/ShaperClass.pm | 10 |
2 files changed, 10 insertions, 13 deletions
diff --git a/lib/Vyatta/Qos/RoundRobin.pm b/lib/Vyatta/Qos/RoundRobin.pm index 83a41b7..7cd6b4f 100644 --- a/lib/Vyatta/Qos/RoundRobin.pm +++ b/lib/Vyatta/Qos/RoundRobin.pm @@ -41,16 +41,9 @@ sub _getClasses { my @classes; my $config = new Vyatta::Config; - $config->setLevel($level); - my $default; - if ( $config->exists("default") ) { - $config->setLevel("$level default"); - $default = new Vyatta::Qos::ShaperClass($config); - $config->setLevel($level); - } - else { - $default = new Vyatta::Qos::ShaperClass; - } + $config->setLevel("$level default"); + my $default = new Vyatta::Qos::ShaperClass($config); + push @classes, $default; $default->{id} = 1; diff --git a/lib/Vyatta/Qos/ShaperClass.pm b/lib/Vyatta/Qos/ShaperClass.pm index ef18f30..361eb57 100644 --- a/lib/Vyatta/Qos/ShaperClass.pm +++ b/lib/Vyatta/Qos/ShaperClass.pm @@ -209,11 +209,15 @@ sub gen_class { sub gen_leaf { my ( $self, $dev, $parent, $rate ) = @_; + my $qtype = $self->{_qdisc}; + return unless $qtype; # default is okay - printf "qdisc add dev %s parent %x:%x ", $dev, $parent, $self->{id}; + my $q = $qdiscOptions{$qtype}; + die "Unknown queue-type $qtype\n" + unless $q; - my $q = $qdiscOptions{ $self->{_qdisc} }; - $q->( $self, $dev, $rate ) if ($q); + printf "qdisc add dev %s parent %x:%x ", $dev, $parent, $self->{id}; + $q->( $self, $dev, $rate ); } sub dsmarkClass { |