X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=blobdiff_plain;f=html%2Fcgi-bin%2Ffirewall.cgi;h=86cba60ccbe0e3d58e82b50d66edb9ddf653226d;hp=2a9415a9ddbcda456ca7ea7fd211c03abab39f82;hb=d334d7cb47ad4b55a24d54ff7f7081e9bb60ed1c;hpb=d99f0ff8c620a7fa832354d403cf701120273d40
diff --git a/html/cgi-bin/firewall.cgi b/html/cgi-bin/firewall.cgi
index 2a9415a9d..86cba60cc 100644
--- a/html/cgi-bin/firewall.cgi
+++ b/html/cgi-bin/firewall.cgi
@@ -609,6 +609,19 @@ sub checktarget
$errormessage.=$Lang::tr{'fwdfw err notgtip'};
return $errormessage;
}
+ #check for mac in targetgroup
+ if ($fwdfwsettings{'grp2'} eq 'cust_grp_tgt'){
+ &General::readhasharray("$configgrp", \%customgrp);
+ &General::readhasharray("$confighost", \%customhost);
+ foreach my $grpkey (sort keys %customgrp){
+ foreach my $hostkey (sort keys %customhost){
+ if ($customgrp{$grpkey}[2] eq $customhost{$hostkey}[0] && $customhost{$hostkey}[1] eq 'mac'){
+ $hint=$Lang::tr{'fwdfw hint mac'};
+ return $hint;
+ }
+ }
+ }
+ }
#check empty fields
if ($fwdfwsettings{$fwdfwsettings{'grp2'}} eq ''){ $errormessage.=$Lang::tr{'fwdfw err notgt'}." ";}
#check tgt services
@@ -729,20 +742,32 @@ sub checkrule
{
#check valid port for NAT
if($fwdfwsettings{'USE_NAT'} eq 'ON'){
- #RULE_ACTION must be on if we use NAT
+ #RULE_ACTION must be ACCEPT if we use NAT
$fwdfwsettings{'RULE_ACTION'} = 'ACCEPT';
+ #if no dnat or snat selected errormessage
+ if ($fwdfwsettings{'nat'} eq ''){
+ $errormessage=$Lang::tr{'fwdfw dnat nochoice'};
+ return;
+ }
+
+ #if using snat, the external port has to be empty
+ if ($fwdfwsettings{'nat'} eq 'snat' && $fwdfwsettings{'dnatport'} ne ''){
+ $errormessage=$Lang::tr{'fwdfw dnat extport'};
+ return;
+ }
#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 '' && $fwdfwsettings{'dnatport'} ne '' && ($fwdfwsettings{'PROT'} eq 'TCP' || $fwdfwsettings{'PROT'} eq 'UDP')){
$errormessage=$Lang::tr{'fwdfw dnat porterr2'};
+ return;
}
#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'}." ";
}elsif($fwdfwsettings{'USESRV'} eq 'ON' && $fwdfwsettings{'grp3'} eq 'cust_srv'){
my $custsrvport;
- #get servcie Protocol and Port
+ #get service Protocol and Port
foreach my $key (sort keys %customservice){
if($fwdfwsettings{$fwdfwsettings{'grp3'}} eq $customservice{$key}[0]){
if ($customservice{$key}[2] ne 'TCP' && $customservice{$key}[2] ne 'UDP'){
@@ -976,7 +1001,6 @@ sub error
print "$errormessage\n";
print " \n";
&Header::closebox();
- print"
";
}
}
sub fillselect
@@ -1020,7 +1044,7 @@ sub gen_dd_block
print<
-
+
$Lang::tr{'fwhost stdnet'}
";
}
#End left table. start right table (vpn)
- print"