summaryrefslogtreecommitdiff
path: root/lib/Vyatta/Qos
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-06-15 15:33:30 -0700
committerStephen Hemminger <shemminger@lenny.localdomain>2009-10-01 13:51:20 -0700
commit54aa517fcde3cb0165a06c72aa008e81e6689a4e (patch)
tree99524e570999b0a1ba95a98cb9229d96d4192710 /lib/Vyatta/Qos
parent737f6fa46eefdcfda1150c9647c0a7a919de71ae (diff)
downloadvyatta-cfg-qos-54aa517fcde3cb0165a06c72aa008e81e6689a4e.tar.gz
vyatta-cfg-qos-54aa517fcde3cb0165a06c72aa008e81e6689a4e.zip
Fix IPV6 traffic-class match
This resolves issues with mulitple filters (can't have same priority), and IPV6 traffic-class/dscp match rules Bug 4552 (cherry picked from commit da8a3fdc4e5cc526bb28f6959944f3635c23a6ed)
Diffstat (limited to 'lib/Vyatta/Qos')
-rw-r--r--lib/Vyatta/Qos/Match.pm21
1 files changed, 16 insertions, 5 deletions
diff --git a/lib/Vyatta/Qos/Match.pm b/lib/Vyatta/Qos/Match.pm
index 682996f..033aee1 100644
--- a/lib/Vyatta/Qos/Match.pm
+++ b/lib/Vyatta/Qos/Match.pm
@@ -75,11 +75,13 @@ sub filter {
my $ip = $self->{$ipver};
next unless $ip && $$ip{dsfield};
- printf "filter add dev %s parent %x: protocol %s prio 1",
+ printf "filter add dev %s parent %x: protocol %s prio $prio",
$dev, $parent, $ipver;
printf " handle %s tcindex classid %x:%x\n",
$$ip{dsfield}, $parent, $classid;
- }
+
+ $prio += 1;
+ }
return;
}
@@ -88,7 +90,10 @@ sub filter {
next unless $p;
printf "filter add dev %s parent %x:", $dev, $parent;
- printf " prio %d", $prio if ($prio);
+ if ($prio) {
+ printf " prio %d", $prio;
+ $prio += 1;
+ }
if ($proto eq 'ether') {
my $type = $$p{protocol};
@@ -106,8 +111,14 @@ sub filter {
print " protocol $proto u32";
# workaround inconsistent usage in tc u32 match
- my $sel = ($proto eq 'ipv6') ? 'ip6' : $proto;
- print " match $sel dsfield $$p{dsfield} 0xff" if $$p{dsfield};
+ my $sel = $proto;
+ if ($proto eq 'ipv6') {
+ $sel = 'ip6';
+ printf " match u16 0x%x 0x0ff0 at 0", hex($$p{dsfield}) << 4,
+ if $$p{dsfield};
+ } else {
+ print " match $sel dsfield $$p{dsfield} 0xff" if $$p{dsfield};
+ }
print " match $sel protocol $$p{protocol} 0xff" if $$p{protocol};
print " match $sel src $$p{src}" if $$p{src};