From 84760edb738bef4341d5e3ea315ccd85a080fd37 Mon Sep 17 00:00:00 2001 From: teastep Date: Fri, 22 Jun 2007 14:47:16 +0000 Subject: [PATCH] More careful editing of icmp types git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6645 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Chains.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Shorewall-perl/Shorewall/Chains.pm b/Shorewall-perl/Shorewall/Chains.pm index 650e0abe8..9ae008485 100644 --- a/Shorewall-perl/Shorewall/Chains.pm +++ b/Shorewall-perl/Shorewall/Chains.pm @@ -850,7 +850,11 @@ sub validate_icmp( $ ) { my $value = $icmp_types{$type}; return $value if defined $value; - return $type if $type =~ /^(\d+)(\/\d+)?$/; + + if ( $type =~ /^(\d+)(\/(\d+))?$/ ) { + return $type if $1 < 256 && ( ! $2 || $3 < 256 ); + } + fatal_error "Invalid ICMP Type ($type)" }