summaryrefslogtreecommitdiff
path: root/lib/Vyatta
diff options
context:
space:
mode:
authorMohit Mehta <mohit.mehta@vyatta.com>2009-08-07 18:47:17 -0700
committerMohit Mehta <mohit.mehta@vyatta.com>2009-08-07 18:47:17 -0700
commitc91b9c6c32c8494c28f1e455a40445a6818b1c2e (patch)
treedbe9dcaa94c94679b96d29b680566682dceb8863 /lib/Vyatta
parent592cf5dd67d71e80b495b9e779b0713078fad5b4 (diff)
downloadvyatta-cfg-c91b9c6c32c8494c28f1e455a40445a6818b1c2e.tar.gz
vyatta-cfg-c91b9c6c32c8494c28f1e455a40445a6818b1c2e.zip
check if port name is valid for both tcp and udp when protocol tcp_udp
Diffstat (limited to 'lib/Vyatta')
-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;