summaryrefslogtreecommitdiff
path: root/lib/Vyatta
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Vyatta')
-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;