mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 19:23:24 +02:00
Firewall: Bugfix - when using addressgroups with mac addresses in source, the mac rule was not correctly created.
Further MAC issues: in target area, the manual ip field was target ip/mac address - changed to IP-Address Also implemented a plausicheck, if an addressgroup with mac addresses is used in target area, theres a hint saying that the rule will not be applied for mac hosts
This commit is contained in:
committed by
Michael Tremer
parent
146636ae78
commit
d334d7cb47
@@ -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'}."<br>";}
|
||||
#check tgt services
|
||||
@@ -1403,25 +1416,8 @@ sub hint
|
||||
print "<class name='base'>$hint\n";
|
||||
print " </class>\n";
|
||||
&Header::closebox();
|
||||
print"<hr>";
|
||||
}
|
||||
}
|
||||
sub inc_counter
|
||||
{
|
||||
my $config=shift;
|
||||
my %hash=%{(shift)};
|
||||
my $val=shift;
|
||||
my $pos;
|
||||
|
||||
&General::readhasharray($config, \%hash);
|
||||
foreach my $key (sort { uc($hash{$a}[0]) cmp uc($hash{$b}[0]) } keys %hash){
|
||||
if($hash{$key}[0] eq $val){
|
||||
$pos=$#{$hash{$key}};
|
||||
$hash{$key}[$pos] = $hash{$key}[$pos]+1;
|
||||
}
|
||||
}
|
||||
&General::writehasharray($config, \%hash);
|
||||
}
|
||||
sub newrule
|
||||
{
|
||||
&error;
|
||||
|
||||
Reference in New Issue
Block a user