summaryrefslogtreecommitdiff
path: root/lib/Vyatta/Qos/TrafficLimiter.pm
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-07-20 18:28:21 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-07-20 18:32:55 -0700
commit4d3064d0aaf2fd58337fa887df280e3b67456ddf (patch)
treeb8dd929d507fa22483a223e0b444f8d5f05e7235 /lib/Vyatta/Qos/TrafficLimiter.pm
parentff1d96e4d80b2e39a7597b5f496538da13d910dc (diff)
downloadvyatta-cfg-qos-4d3064d0aaf2fd58337fa887df280e3b67456ddf.tar.gz
vyatta-cfg-qos-4d3064d0aaf2fd58337fa887df280e3b67456ddf.zip
Fix default match rule
Need to generate a filter to cause default filter rule to exist. Otherwise default does nothing.
Diffstat (limited to 'lib/Vyatta/Qos/TrafficLimiter.pm')
-rw-r--r--lib/Vyatta/Qos/TrafficLimiter.pm31
1 files changed, 17 insertions, 14 deletions
diff --git a/lib/Vyatta/Qos/TrafficLimiter.pm b/lib/Vyatta/Qos/TrafficLimiter.pm
index c30cbb9..93ea302 100644
--- a/lib/Vyatta/Qos/TrafficLimiter.pm
+++ b/lib/Vyatta/Qos/TrafficLimiter.pm
@@ -100,21 +100,24 @@ sub commands {
}
foreach my $class (@$classes) {
- foreach my $match ( $class->matchRules() ) {
- my $id = $class->{id};
- $id = $maxid + 1 if ( $id == 0 );
-
- my $police =
- " police rate "
- . $class->{rate}
- . " action drop burst "
- . $class->{burst};
-
- $match->filter( $dev, $parent, $id, $class->{priority}, undef,
- $police );
- }
+ my $id = $class->{id};
+ my $police = " police rate " . $class->{rate}
+ . " action drop burst " . $class->{burst};
+
+ if ($id == 0) {
+ $id = $maxid + 1;
+
+ # Null filter for default rule
+ printf "filter add dev %s parent %x: prio %d", $dev, $parent, 255;
+ print " protocol all basic";
+ print " %s flowid %x:%x\n", $police, $parent, $id;
+ } else {
+ foreach my $match ( $class->matchRules() ) {
+ $match->filter( $dev, $parent, $id, $class->{priority}, undef,
+ $police );
+ }
+ }
}
-
}
1;