diff --git a/Shorewall/Perl/Shorewall/IPAddrs.pm b/Shorewall/Perl/Shorewall/IPAddrs.pm index 56f9f225d..1971e9df7 100644 --- a/Shorewall/Perl/Shorewall/IPAddrs.pm +++ b/Shorewall/Perl/Shorewall/IPAddrs.pm @@ -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( $ ) {