summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlib/Vyatta/Misc.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Vyatta/Misc.pm b/lib/Vyatta/Misc.pm
index 7f5e506..5852e84 100755
--- a/lib/Vyatta/Misc.pm
+++ b/lib/Vyatta/Misc.pm
@@ -358,7 +358,15 @@ sub getPortRuleString {
return ( undef, $err );
}
}
- ( $success, $err ) = isValidPortName( $port_spec, $proto );
+ if ($proto eq 'tcp_udp') {
+ ( $success, $err ) = isValidPortName( $port_spec, 'tcp' );
+ if (defined $success) {
+ # only do udp test if the tcp test was a success
+ ( $success, $err ) = isValidPortName( $port_spec, 'udp' )
+ }
+ } else {
+ ( $success, $err ) = isValidPortName( $port_spec, $proto );
+ }
if ( defined($success) ) {
$num_ports += 1;
next;