summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-02-13 15:11:34 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-02-13 15:11:34 -0800
commit85296d793a2320485fb075ae9ee09b62c72f8e96 (patch)
treec791778402c9d9f4755a41bf7bce526b4e3e2a6b /scripts
parent8132689b6e461ad068746741bfec1bd82efbe915 (diff)
downloadvyatta-cfg-qos-85296d793a2320485fb075ae9ee09b62c72f8e96.tar.gz
vyatta-cfg-qos-85296d793a2320485fb075ae9ee09b62c72f8e96.zip
catch errors where dscp name is not defined
This enforces syntax checks on dscp values.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/VyattaQosUtil.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/VyattaQosUtil.pm b/scripts/VyattaQosUtil.pm
index 1d4a5e2..86b091a 100644
--- a/scripts/VyattaQosUtil.pm
+++ b/scripts/VyattaQosUtil.pm
@@ -129,7 +129,8 @@ sub getDsfield {
}
}
close($ds) or die "read $dsFileName error\n";
-
+
+ (defined $match) or die "\"$str\" unknown dsfield value\n";
return $match;
}
@@ -140,6 +141,7 @@ sub getIfIndex {
open my $sysfs, "<", "/sys/class/net/$str/ifindex" || die "Unknown interface $str\n";
my $ifindex = <$sysfs>;
close($sysfs) or die "read sysfs error\n";
+ chomp $ifindex;
return $ifindex;
}