Firewall: appended check of maximum ports per protocol. portranges 100:200 count as 2 ports

This commit is contained in:
Alexander Marx
2013-11-12 16:04:55 +01:00
committed by Michael Tremer
parent 49192c7b31
commit 7db6ad6acb

View File

@@ -775,14 +775,16 @@ if ($fwhostsettings{'ACTION'} eq 'saveservicegrp')
if($customservicegrp{$key}[0] eq $fwhostsettings{'SRVGRP_NAME'}){
foreach my $key1 (keys %customservice){
$tcpcounter++ if $customservice{$key1}[2] eq 'TCP' && $customservicegrp{$key}[2] eq $customservice{$key1}[0];
$tcpcounter++ if $customservice{$key1}[2] eq 'TCP' && $customservicegrp{$key}[2] eq $customservice{$key1}[0] && $customservice{$key1}[1] =~m/:/i;
$udpcounter++ if $customservice{$key1}[2] eq 'UDP' && $customservicegrp{$key}[2] eq $customservice{$key1}[0];
$udpcounter++ if $customservice{$key1}[2] eq 'UDP' && $customservicegrp{$key}[2] eq $customservice{$key1}[0] && $customservice{$key1}[1] =~m/:/i;
}
}
}
if ($tcpcounter > 13){
if ($tcpcounter > 15){
$errormessage=$Lang::tr{'fwhost err maxservicetcp'};
}
if ($udpcounter > 13){
if ($udpcounter > 15){
$errormessage=$Lang::tr{'fwhost err maxserviceudp'};
}
$tcpcounter=0;