mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-20 01:37:59 +02:00
Simplify port == 0 test
This commit is contained in:
parent
bd9c0ac285
commit
d43ba935d1
@ -302,8 +302,7 @@ sub validate_port( $$ ) {
|
|||||||
my $value;
|
my $value;
|
||||||
|
|
||||||
if ( $port =~ /^(\d+)$/ ) {
|
if ( $port =~ /^(\d+)$/ ) {
|
||||||
fatal_error "Invalid Port Number (0)" unless $port;
|
return $port if $port && $port <= 65535;
|
||||||
return $port if $port <= 65535;
|
|
||||||
} else {
|
} else {
|
||||||
$proto = proto_name $proto if $proto =~ /^(\d+)$/;
|
$proto = proto_name $proto if $proto =~ /^(\d+)$/;
|
||||||
$value = getservbyname( $port, $proto );
|
$value = getservbyname( $port, $proto );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user