diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-07-15 13:37:32 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-07-15 13:37:32 -0700 |
commit | 0654461530daf65ae79d40b54399eae3183a3062 (patch) | |
tree | 5dd82fd219d9762896e172a903431ba018b2ca49 | |
parent | f6055d71f7cb7c2fb99b770982e498959a57c5af (diff) | |
parent | 37b40196e9b647b665b53c3ffd6d8535cbd5d880 (diff) | |
download | vyatta-cfg-qos-0654461530daf65ae79d40b54399eae3183a3062.tar.gz vyatta-cfg-qos-0654461530daf65ae79d40b54399eae3183a3062.zip |
Merge branch 'larkspur' of vm:git/vyatta-cfg-qos into larkspur
-rw-r--r-- | lib/Vyatta/Qos/Match.pm | 7 | ||||
-rw-r--r-- | lib/Vyatta/Qos/RoundRobin.pm | 4 | ||||
-rw-r--r-- | lib/Vyatta/Qos/TrafficLimiter.pm | 3 | ||||
-rw-r--r-- | lib/Vyatta/Qos/TrafficShaper.pm | 4 |
4 files changed, 11 insertions, 7 deletions
diff --git a/lib/Vyatta/Qos/Match.pm b/lib/Vyatta/Qos/Match.pm index 591c2b0..cb5d4ff 100644 --- a/lib/Vyatta/Qos/Match.pm +++ b/lib/Vyatta/Qos/Match.pm @@ -66,8 +66,6 @@ sub new { $self->{_fwmark} = $fwmark; if ($ptype) { - die "Can not combine protocol and firewall mark match\n" - if ($fwmark); die "Can not combine protocol and vlan tag match\n" if ($vif); die "Can not combine protocol and interface match\n" @@ -100,6 +98,7 @@ sub filter { return; } + my $fwmark = $self->{_fwmark}; foreach my $proto (qw(ip ipv6 ether)) { my $p = $self->{$proto}; next unless $p; @@ -137,12 +136,12 @@ sub filter { print " match $sel dport $$p{dport} 0xffff" if $$p{dport}; } - print " $police" if $police; + print " match mark $fwmark 0xff" if $fwmark; + print " $police" if $police; printf " flowid %x:%x\n", $parent, $classid; return; } - my $fwmark = $self->{_fwmark}; my $indev = $self->{_indev}; my $vif = $self->{_vif}; if ( defined($vif) || defined($indev) ) { diff --git a/lib/Vyatta/Qos/RoundRobin.pm b/lib/Vyatta/Qos/RoundRobin.pm index a1d7787..b7d72b2 100644 --- a/lib/Vyatta/Qos/RoundRobin.pm +++ b/lib/Vyatta/Qos/RoundRobin.pm @@ -67,8 +67,10 @@ sub commands { foreach my $class (@$classes) { $class->gen_class( $dev, 'drr', $parent ); $class->gen_leaf( $dev, $parent ); + my $prio = 1; + foreach my $match ( $class->matchRules() ) { - $match->filter( $dev, $parent, $class->{id}, 1); + $match->filter( $dev, $parent, $class->{id}, $prio++); } } } diff --git a/lib/Vyatta/Qos/TrafficLimiter.pm b/lib/Vyatta/Qos/TrafficLimiter.pm index 665f784..b731c64 100644 --- a/lib/Vyatta/Qos/TrafficLimiter.pm +++ b/lib/Vyatta/Qos/TrafficLimiter.pm @@ -106,7 +106,8 @@ sub commands { my $police = " police rate " . $class->{rate} . " action drop burst " . $class->{burst}; - $match->filter( $dev, $parent, $id, $class->{priority}, undef, $police ); + $match->filter( $dev, $parent, $id, $class->{priority}, + undef, $police ); } } diff --git a/lib/Vyatta/Qos/TrafficShaper.pm b/lib/Vyatta/Qos/TrafficShaper.pm index f89ae60..4fa3008 100644 --- a/lib/Vyatta/Qos/TrafficShaper.pm +++ b/lib/Vyatta/Qos/TrafficShaper.pm @@ -151,8 +151,10 @@ sub commands { $class->gen_class( $dev, 'htb', $parent, $rate ); $class->gen_leaf( $dev, $parent, $rate ); + my $prio = 1; foreach my $match ( $class->matchRules() ) { - $match->filter( $dev, $parent, $class->{id}, 1, $class->{dsmark} ); + $match->filter( $dev, $parent, $class->{id}, + $prio++, $class->{dsmark} ); } } } |