diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-07-20 18:28:21 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-07-20 18:32:55 -0700 |
commit | 4d3064d0aaf2fd58337fa887df280e3b67456ddf (patch) | |
tree | b8dd929d507fa22483a223e0b444f8d5f05e7235 /lib/Vyatta/Qos/TrafficLimiter.pm | |
parent | ff1d96e4d80b2e39a7597b5f496538da13d910dc (diff) | |
download | vyatta-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.pm | 31 |
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; |