summaryrefslogtreecommitdiff
path: root/lib/Vyatta
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-05-28 16:15:04 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-05-28 16:15:04 -0700
commit9488f3c64e0c29ce22631fae3f22ffb73b8349cb (patch)
tree441f0de2c6d13bd4b14f3a07fb5c353c8b1b265f /lib/Vyatta
parent0eca7ca8d325375643bf3d1f498345565fef24e0 (diff)
downloadvyatta-cfg-qos-9488f3c64e0c29ce22631fae3f22ffb73b8349cb.tar.gz
vyatta-cfg-qos-9488f3c64e0c29ce22631fae3f22ffb73b8349cb.zip
Allow netem without network delay value
Bug 4466 Need to allow policy without delay value.
Diffstat (limited to 'lib/Vyatta')
-rw-r--r--lib/Vyatta/Qos/NetworkEmulator.pm16
1 files changed, 3 insertions, 13 deletions
diff --git a/lib/Vyatta/Qos/NetworkEmulator.pm b/lib/Vyatta/Qos/NetworkEmulator.pm
index 1fb9fc6..2a87407 100644
--- a/lib/Vyatta/Qos/NetworkEmulator.pm
+++ b/lib/Vyatta/Qos/NetworkEmulator.pm
@@ -23,33 +23,23 @@ use warnings;
require Vyatta::Config;
use Vyatta::Qos::Util;
-my %fields = (
- _rate => undef,
- _burst => undef,
- _limit => undef,
- _delay => undef,
- _drop => undef,
- _corrupt => undef,
- _reorder => undef,
-);
-
sub new {
my ( $that, $config ) = @_;
my $level = $config->setLevel();
my $class = ref($that) || $that;
- my $self = {%fields};
+ my $self = { };
my $bw = $config->returnValue("bandwidth");
$self->{_rate} = getRate( $bw ) if ($bw);
+ my $delay = $config->returnValue("network-delay");
+ $self->{_delay} = getTime($delay) if ($delay);
$self->{_burst} = $config->returnValue("burst");
$self->{_limit} = $config->returnValue("queue-limit");
- $self->{_delay} = getTime($config->returnValue("network-delay"));
$self->{_drop} = $config->returnValue("packet-loss");
$self->{_corrupt} = $config->returnValue("packet-corruption");
$self->{_reorder} = $config->returnValue("packet-reordering");
-
return bless $self, $class;
}