summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/VyattaQosMatch.pm4
-rw-r--r--scripts/VyattaQosTrafficShaper.pm20
2 files changed, 20 insertions, 4 deletions
diff --git a/scripts/VyattaQosMatch.pm b/scripts/VyattaQosMatch.pm
index 9904274..334b7c1 100644
--- a/scripts/VyattaQosMatch.pm
+++ b/scripts/VyattaQosMatch.pm
@@ -30,10 +30,6 @@ sub _define {
if ($config->exists("ip")) {
my %ip;
- if (defined $self->{_dev} || defined $self->{_vif}) {
- die "Match on both ip field and device not supported\n";
- }
-
$ip{dsfield} = VyattaQosUtil::getDsfield( $config->returnValue("ip dscp"));
$ip{protocol} = VyattaQosUtil::getProtocol($config->returnValue("ip protocol"));
$ip{src} = $config->returnValue("ip source address");
diff --git a/scripts/VyattaQosTrafficShaper.pm b/scripts/VyattaQosTrafficShaper.pm
index 361a2dd..854ee41 100644
--- a/scripts/VyattaQosTrafficShaper.pm
+++ b/scripts/VyattaQosTrafficShaper.pm
@@ -173,6 +173,26 @@ sub _define {
$config->exists("default")
or die "Configuration not complete: missing default class\n";
+
+ # make sure no clash of different types of tc filters
+ my %matchTypes = ();
+ foreach my $class ( $config->listNodes("class")) {
+ foreach my $match ( $config->listNodes("class $class match") ) {
+ foreach my $type ( $config->listNodes("class $class match $match") ) {
+ $matchTypes{$type} = "$class match $match";
+ }
+ }
+ }
+
+ if (scalar keys %matchTypes > 1 && $matchTypes{ip}) {
+ print "Match type conflict:\n";
+ while (my ($type, $usage) = each(%matchTypes)) {
+ print " class $usage $type\n";
+ }
+ die "Can't match on both ip and other types\n";
+ }
+
+
$config->setLevel("$level default");
push @classes, new ShaperClass($config, -1);
$config->setLevel($level);