Firewall: when DNAT external port is given and dest port is empty, theres now an errormessage displayed

This commit is contained in:
Alexander Marx
2013-12-20 12:53:46 +01:00
committed by Michael Tremer
parent a8b113e73d
commit 3c037075d0
10 changed files with 16 additions and 1 deletions

View File

@@ -729,8 +729,11 @@ sub checkrule
{
#check valid port for NAT
if($fwdfwsettings{'USE_NAT'} eq 'ON'){
#if no port is given in nat area, take target host port
#if no dest port is given in nat area, take target host port
if($fwdfwsettings{'nat'} eq 'dnat' && $fwdfwsettings{'grp3'} eq 'TGT_PORT' && $fwdfwsettings{'dnatport'} eq ''){$fwdfwsettings{'dnatport'}=$fwdfwsettings{'TGT_PORT'};}
if($fwdfwsettings{'TGT_PORT'} eq ''){
$errormessage=$Lang::tr{'fwdfw dnat porterr2'};
}
#check if port given in nat area is a single valid port or portrange
if($fwdfwsettings{'nat'} eq 'dnat' && $fwdfwsettings{'TGT_PORT'} ne '' && !&check_natport($fwdfwsettings{'dnatport'})){
$errormessage=$Lang::tr{'fwdfw target'}.": ".$Lang::tr{'fwdfw dnat porterr'}."<br>";