From d43ba935d13848cbc80edc531d88b377f577063b Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Sun, 22 Nov 2009 09:03:01 -0800 Subject: [PATCH] Simplify port == 0 test --- Shorewall/Perl/Shorewall/IPAddrs.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Shorewall/Perl/Shorewall/IPAddrs.pm b/Shorewall/Perl/Shorewall/IPAddrs.pm index 47342de4b..15d4744fa 100644 --- a/Shorewall/Perl/Shorewall/IPAddrs.pm +++ b/Shorewall/Perl/Shorewall/IPAddrs.pm @@ -302,8 +302,7 @@ sub validate_port( $$ ) { my $value; if ( $port =~ /^(\d+)$/ ) { - fatal_error "Invalid Port Number (0)" unless $port; - return $port if $port <= 65535; + return $port if $port && $port <= 65535; } else { $proto = proto_name $proto if $proto =~ /^(\d+)$/; $value = getservbyname( $port, $proto );