summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-02-06 16:58:06 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-02-06 16:58:06 -0800
commit49decef8f62c517071c76b620f6f19ef90a8cbf8 (patch)
tree66cff9467b6a02b5c72044b66a0ffafbc6355640
parent248920901afa3f1b6d2d461057f51164b66de041 (diff)
downloadvyatta-cfg-qos-49decef8f62c517071c76b620f6f19ef90a8cbf8.tar.gz
vyatta-cfg-qos-49decef8f62c517071c76b620f6f19ef90a8cbf8.zip
fixes for match on vlan or interface
need to lookup ifindex for interface not vlan tag (duh) and ip field should be initialized only when ip tag is found.
-rw-r--r--scripts/VyattaQosMatch.pm18
1 files changed, 6 insertions, 12 deletions
diff --git a/scripts/VyattaQosMatch.pm b/scripts/VyattaQosMatch.pm
index 4b2e3fe..7263afc 100644
--- a/scripts/VyattaQosMatch.pm
+++ b/scripts/VyattaQosMatch.pm
@@ -6,14 +6,7 @@ use strict;
my %fields = (
_dev => undef,
_vif => undef,
- _ip => {
- src => undef,
- dst => undef,
- dsfield => undef,
- protocol => undef,
- sport => undef,
- dport => undef,
- }
+ _ip => undef,
);
sub new {
@@ -31,8 +24,9 @@ sub _define {
my ( $self, $config ) = @_;
my $level = $config->setLevel();
- $self->{_vif} = VyattaQosUtil::getIfIndex($config->returnValue("vif"));
- $self->{_dev} = $config->returnValue("interface");
+ $self->{_vif} = $config->returnValue("vif");
+ $self->{_dev} = VyattaQosUtil::getIfIndex($config->returnValue("interface"));
+
if ($config->exists("ip")) {
my %ip;
@@ -63,11 +57,11 @@ sub filter {
}
if (defined $self->{_dev}) {
- print {$out} " basic meta match meta \(rt_iif eq $self->{_dev}\)";
+ print {$out} " basic match meta \(rt_iif eq $self->{_dev}\)";
}
if (defined $self->{_vif}) {
- print {$out} " basic meta match meta \(vlan mask 0xfff eq $self->{_vif}\)";
+ print {$out} " basic match meta \(vlan mask 0xfff eq $self->{_vif}\)";
}
print {$out} " classid 1:$id\n";