Forward Firewall: Network addresses are now allowed as source and the ip addressfield...
authorAlexander Marx <amarx@ipfire.org>
Wed, 31 Jul 2013 06:28:29 +0000 (08:28 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 9 Aug 2013 12:49:35 +0000 (14:49 +0200)
html/cgi-bin/forwardfw.cgi
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl

index 427d4a131937e4ef3b77a7beb6263dedfd4ebbc8..bd8cea8edcf799e88cda38962a82a19209f171fa 100755 (executable)
@@ -433,7 +433,9 @@ sub checksource
                }
 
                if ($fwdfwsettings{'isip'} ne 'on'){
-                       if (&General::validmac($fwdfwsettings{'src_addr'})){$fwdfwsettings{'ismac'}='on';}
+                       if (&General::validmac($fwdfwsettings{'src_addr'})){
+                               $fwdfwsettings{'ismac'}='on';
+                       }
                }
                if ($fwdfwsettings{'isip'} eq 'on'){
                        ##check if ip is valid
@@ -445,12 +447,6 @@ sub checksource
                        $ip=&General::ip2dec($ip);
                        $ip=&General::dec2ip($ip);
                        #check if net or broadcast
-                       my @tmp= split (/\./,$ip);
-                       if (($tmp[3] eq "0") || ($tmp[3] eq "255"))
-                       {
-                               $errormessage=$Lang::tr{'fwhost err hostip'}."<br>";
-                               return $errormessage;
-                       }
                        $fwdfwsettings{'src_addr'}="$ip/$subnet";
                        if(!&General::validipandmask($fwdfwsettings{'src_addr'})){
                                $errormessage.=$Lang::tr{'fwdfw err src_addr'}."<br>";
@@ -1535,7 +1531,7 @@ sub newrule
        #------SOURCE-------------------------------------------------------
        print<<END;
                <table width='100%' border='0'>
-               <tr><td width='1%'><input type='radio' name='grp1' value='src_addr'  checked></td><td width='60%'>$Lang::tr{'fwdfw sourceip'}<input type='TEXT' name='src_addr' value='$fwdfwsettings{'src_addr'}' size='16' maxlength='17' ></td><td width='1%'><input type='radio' name='grp1' id='ipfire_src' value='ipfire_src'  $checked{'grp1'}{'ipfire_src'}></td><td><b>Firewall</b></td>
+               <tr><td width='1%'><input type='radio' name='grp1' value='src_addr'  checked></td><td width='60%'>$Lang::tr{'fwdfw sourceip'}<input type='TEXT' name='src_addr' value='$fwdfwsettings{'src_addr'}' size='16' maxlength='18' ></td><td width='1%'><input type='radio' name='grp1' id='ipfire_src' value='ipfire_src'  $checked{'grp1'}{'ipfire_src'}></td><td><b>Firewall</b></td>
 END
                print"<td align='right'><select name='ipfire_src' style='width:200px;'>";
                print "<option value='ALL' $selected{'ipfire_src'}{'ALL'}>$Lang::tr{'all'}</option>";
@@ -1593,7 +1589,7 @@ END
                &Header::openbox('100%', 'left', $Lang::tr{'fwdfw target'});
                print<<END;
                <table width='100%' border='0'> 
-               <tr><td width='1%'><input type='radio' name='grp2' value='tgt_addr'  checked></td><td width='60%' nowrap='nowrap'>$Lang::tr{'fwdfw targetip'}<input type='TEXT' name='tgt_addr' value='$fwdfwsettings{'tgt_addr'}' size='16' maxlength='17'><td width='1%'><input type='radio' name='grp2' id='ipfire' value='ipfire'  $checked{'grp2'}{'ipfire'}></td><td><b>Firewall</b></td>
+               <tr><td width='1%'><input type='radio' name='grp2' value='tgt_addr'  checked></td><td width='60%' nowrap='nowrap'>$Lang::tr{'fwdfw targetip'}<input type='TEXT' name='tgt_addr' value='$fwdfwsettings{'tgt_addr'}' size='16' maxlength='18'><td width='1%'><input type='radio' name='grp2' id='ipfire' value='ipfire'  $checked{'grp2'}{'ipfire'}></td><td><b>Firewall</b></td>
 END
                print"<td align='right'><select name='ipfire' style='width:200px;'>";
                print "<option value='ALL' $selected{'ipfire'}{'ALL'}>$Lang::tr{'all'}</option>";
index ef22ba366671c631664ce7a09e2b5c54117e36c4..818c31ab1558cb9975d29562f74bf03cf9e1dda0 100644 (file)
 'fwhost err net'               => 'Netzwerk IP Adresse existiert bereits',
 'fwhost err mac'               => 'MAC Adresse ungültig',
 'fwhost err hostexist' => 'Ein Host mit diesem Namen existiert bereits',
-'fwhost err hostip'    => 'Netz- oder Broadcastadressen sind nicht erlaubt',
 'fwhost err hostorip'  => 'Name oder IP Adresse ungültig',
 'fwhost err isccdhost' => 'Dieser Name wird bereits für einen Openvpn Host verwendet',
 'fwhost err isccdipnet'        => 'Diese IP Adresse wird bereits für einen Openvpn Netzwerk verwendet',
index e3ad37c9dc8b36635360bb3a96a25652afb4d755..a0b3db9e639bcfffe8e939482d23a337f2cc16ad 100644 (file)
 'fwhost err net'               => 'Network IP address already exists',
 'fwhost err mac'               => 'MAC address invalid',
 'fwhost err hostexist' => 'A host with this name already exists',
-'fwhost err hostip'    => 'Network or broadcast addresses not allowed',
 'fwhost err hostorip'  => 'Name or IP address invalid',
 'fwhost err isccdhost' => 'This name is already used by an OpenVPN client',
 'fwhost err isccdipnet'        => 'This IP address is already used by an OpenVPN network',