]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
BUG11184: Error if DNAT address ends with 0 or 255 now disabled
authorAlexander Marx <alexander.marx@ipfire.org>
Thu, 15 Sep 2016 13:31:48 +0000 (15:31 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 15 Sep 2016 17:58:51 +0000 (18:58 +0100)
When using dnat addresses, it is possible to use big subnets and host addresses like 172.16.0.0/12.
These addresses where rejected because it was recognised as network address.
The check is now removed.

Signed-off-by: Alexander Marx <alexander.marx@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/firewall.cgi

index 8007182e9d0f079d490d1f88e6f32a5aed00a80e..face0f460974350f10c5bea26f54acb58cd9825e 100644 (file)
@@ -539,16 +539,6 @@ sub checktarget
        #check DNAT settings (has to be single Host and single Port or portrange)
        if ($fwdfwsettings{'USE_NAT'} eq 'ON' && $fwdfwsettings{'nat'} eq 'dnat'){
                if($fwdfwsettings{'grp2'} eq 'tgt_addr' || $fwdfwsettings{'grp2'} eq 'cust_host_tgt' || $fwdfwsettings{'grp2'} eq 'ovpn_host_tgt'){
-                       #check if manual ip is a single Host (if set)
-                       if ($fwdfwsettings{'grp2'} eq 'tgt_addr'){
-                               my @tmp= split (/\./,$fwdfwsettings{$fwdfwsettings{'grp2'}});
-                               my @tmp1= split ("/",$tmp[3]);
-                               if (($tmp1[0] eq "0") || ($tmp1[0] eq "255"))
-                               {
-                                       $errormessage=$Lang::tr{'fwdfw dnat error'}."<br>";
-                                       return $errormessage;
-                               }
-                       }
                        #check if Port is a single Port or portrange
                        if ($fwdfwsettings{'nat'} eq 'dnat' &&  $fwdfwsettings{'grp3'} eq 'TGT_PORT'){
                                if(($fwdfwsettings{'PROT'} ne 'TCP'|| $fwdfwsettings{'PROT'} ne 'UDP') && $fwdfwsettings{'TGT_PORT'} eq ''){