mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-25 09:03:30 +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
8a6543af1b
commit
2e91a5ef43
@ -287,7 +287,12 @@ sub resolve_proto( $ ) {
|
||||
my $proto = $_[0];
|
||||
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( $ ) {
|
||||
|
Loading…
Reference in New Issue
Block a user