diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2009-04-13 11:27:48 -0700 |
---|---|---|
committer | Stephen Hemminger <shemminger@vyatta.com> | 2009-04-13 11:27:48 -0700 |
commit | 8ab89c9b3b1590765c87dfa920f126a6e49528c3 (patch) | |
tree | 3d1e6cb73bf97de1871786ece0f360201ed89baa /lib | |
parent | 8c2895f17e573cd1a4c08bd4682555e41c115931 (diff) | |
download | vyatta-cfg-qos-8ab89c9b3b1590765c87dfa920f126a6e49528c3.tar.gz vyatta-cfg-qos-8ab89c9b3b1590765c87dfa920f126a6e49528c3.zip |
Check for conflicts when match is created
This allows moving code out of the qos class code over to where
match rules are handled.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Vyatta/Qos/Match.pm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Vyatta/Qos/Match.pm b/lib/Vyatta/Qos/Match.pm index 0c45958..765bcb8 100644 --- a/lib/Vyatta/Qos/Match.pm +++ b/lib/Vyatta/Qos/Match.pm @@ -27,12 +27,13 @@ sub new { bless $self, $class; - $self->{_vif} = $config->returnValue("vif"); - $self->{_dev} = getIfIndex($config->returnValue("interface")); - foreach my $ip (qw(ip ipv6)) { next unless $config->exists($ip); + foreach my $t (qw(vif dev)) { + die "can not match on $ip and $t\n" if $config->exists($t); + } + # TODO make this data driven? my %fields; $fields{dsfield} = getDsfield( $config->returnValue("$ip dscp")); @@ -44,6 +45,9 @@ sub new { $self->{$ip} = \%fields; } + $self->{_vif} = $config->returnValue("vif"); + $self->{_dev} = getIfIndex($config->returnValue("interface")); + return $self; } |