summaryrefslogtreecommitdiff
path: root/lib/Vyatta/Qos
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Vyatta/Qos')
-rw-r--r--lib/Vyatta/Qos/Match.pm10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Vyatta/Qos/Match.pm b/lib/Vyatta/Qos/Match.pm
index b2b13da..50e20f1 100644
--- a/lib/Vyatta/Qos/Match.pm
+++ b/lib/Vyatta/Qos/Match.pm
@@ -58,12 +58,14 @@ sub new {
$fields{dsfield} = getDsfield( $config->returnValue("$af dscp") );
my $ipprot = $config->returnValue("$af protocol");
$fields{protocol} = getProtocol($ipprot);
+
$fields{src} = $config->returnValue("$af source address");
$fields{dst} = $config->returnValue("$af destination address");
- $fields{sport} =
- getPort( $config->returnValue("$af source port"), $ipprot );
- $fields{dport} =
- getPort( $config->returnValue("$af destination port"), $ipprot );
+
+ my $port = $config->returnValue("$af source port");
+ $fields{sport} = getPort( $port, $ipprot ) if $port;
+ $port = $config->returnValue("$af destination port");
+ $fields{dport} = getPort( $port, $ipprot ) if $port;
}
$self->{$af} = \%fields;