mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-22 22:30:58 +01:00
More robust checking of zone definitions
This commit is contained in:
parent
5297bb8b8d
commit
d368d80a12
@ -604,6 +604,7 @@ sub add_group_to_zone($$$$$)
|
||||
my @exclusions = ();
|
||||
my $new = \@newnetworks;
|
||||
my $switched = 0;
|
||||
my $allip = 0;
|
||||
|
||||
for my $host ( @$networks ) {
|
||||
$interfaces{$interface}{nets}++;
|
||||
@ -620,7 +621,11 @@ sub add_group_to_zone($$$$$)
|
||||
unless ( $switched ) {
|
||||
if ( $type == $zonetype ) {
|
||||
fatal_error "Duplicate Host Group ($interface:$host) in zone $zone" if $interfaces{$interface}{zone} eq $zone;
|
||||
$interfaces{$interface}{zone} = $zone if $host eq ALLIP;
|
||||
if ( $host eq ALLIP ) {
|
||||
fatal_error "Duplicate Host Group ($interface:$host) in zone $zone" if @newnetworks;
|
||||
$interfaces{$interface}{zone} = $zone;
|
||||
$allip = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -642,6 +647,8 @@ sub add_group_to_zone($$$$$)
|
||||
$typeref = ( $hostsref->{$gtype} || ( $hostsref->{$gtype} = {} ) );
|
||||
$interfaceref = ( $typeref->{$interface} || ( $typeref->{$interface} = [] ) );
|
||||
|
||||
fatal_error "Duplicate Host Group ($interface:" . ALLIP . ") in zone $zone" if $allip && @$interfaceref;
|
||||
|
||||
$zoneref->{options}{complex} = 1 if @$interfaceref || ( @newnetworks > 1 ) || ( @exclusions );
|
||||
|
||||
push @{$interfaceref}, { options => $options,
|
||||
|
Loading…
Reference in New Issue
Block a user