mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-22 18:51:24 +02:00
Disallow port 00
This commit is contained in:
parent
19af1a081c
commit
d5914addd1
@ -26,7 +26,7 @@
|
|||||||
#
|
#
|
||||||
package Shorewall::IPAddrs;
|
package Shorewall::IPAddrs;
|
||||||
require Exporter;
|
require Exporter;
|
||||||
use Shorewall::Config qw( :DEFAULT split_list require_capability in_hex8 F_IPV4 F_IPV6 );
|
use Shorewall::Config qw( :DEFAULT split_list require_capability in_hex8 numeric_value F_IPV4 F_IPV6 );
|
||||||
use Socket;
|
use Socket;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
@ -302,7 +302,8 @@ sub validate_port( $$ ) {
|
|||||||
my $value;
|
my $value;
|
||||||
|
|
||||||
if ( $port =~ /^(\d+)$/ ) {
|
if ( $port =~ /^(\d+)$/ ) {
|
||||||
return $port if $port && $port <= 65535;
|
$port = numeric_value $port;
|
||||||
|
return $port if defined $port && $port && $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