mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-26 09:33:14 +01:00
Allow protocol to be expressed in octal or hex
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
aad8ea837a
commit
47007c5dbd
@ -287,7 +287,12 @@ sub resolve_proto( $ ) {
|
|||||||
my $proto = $_[0];
|
my $proto = $_[0];
|
||||||
my $number;
|
my $number;
|
||||||
|
|
||||||
$proto =~ /^(\d+)$/ ? $proto <= 65535 ? $proto : undef : defined( $number = $nametoproto{$proto} ) ? $number : scalar getprotobyname $proto;
|
if ( $proto =~ /^\d+$/ || $proto =~ /^0x/ ) {
|
||||||
|
$number = numeric_value ( $proto );
|
||||||
|
defined $number && $number <= 65535 ? $number : undef;
|
||||||
|
} else {
|
||||||
|
defined( $number = $nametoproto{$proto} ) ? $number : scalar getprotobyname $proto;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub proto_name( $ ) {
|
sub proto_name( $ ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user