diff options
author | Mohit Mehta <mohit.mehta@vyatta.com> | 2009-08-07 18:47:17 -0700 |
---|---|---|
committer | Mohit Mehta <mohit.mehta@vyatta.com> | 2009-08-07 18:47:17 -0700 |
commit | c91b9c6c32c8494c28f1e455a40445a6818b1c2e (patch) | |
tree | dbe9dcaa94c94679b96d29b680566682dceb8863 /lib/Vyatta | |
parent | 592cf5dd67d71e80b495b9e779b0713078fad5b4 (diff) | |
download | vyatta-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-x | lib/Vyatta/Misc.pm | 10 |
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; |