mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-30 10:08:52 +01:00
Rework some newbie code in add_group_to_zone()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
7cd7f1ebbe
commit
1896e56894
@ -403,7 +403,7 @@ sub parse_zone_option_list($$\$$)
|
|||||||
#
|
#
|
||||||
# Set the super option on the passed zoneref and propagate to its parents
|
# Set the super option on the passed zoneref and propagate to its parents
|
||||||
#
|
#
|
||||||
sub set_super( $ );
|
sub set_super( $ ); #required for recursion
|
||||||
|
|
||||||
sub set_super( $ ) {
|
sub set_super( $ ) {
|
||||||
my $zoneref = shift;
|
my $zoneref = shift;
|
||||||
@ -769,13 +769,13 @@ sub add_group_to_zone($$$$$)
|
|||||||
|
|
||||||
my $gtype = $type & IPSEC ? 'ipsec' : 'ip';
|
my $gtype = $type & IPSEC ? 'ipsec' : 'ip';
|
||||||
|
|
||||||
$hostsref = ( $zoneref->{hosts} || ( $zoneref->{hosts} = {} ) );
|
$hostsref = ( $zoneref->{hosts} ||= {} );
|
||||||
$typeref = ( $hostsref->{$gtype} || ( $hostsref->{$gtype} = {} ) );
|
$typeref = ( $hostsref->{$gtype} ||= {} );
|
||||||
$interfaceref = ( $typeref->{$interface} || ( $typeref->{$interface} = [] ) );
|
$interfaceref = ( $typeref->{$interface} ||= [] );
|
||||||
|
|
||||||
fatal_error "Duplicate Host Group ($interface:" . ALLIP . ") in zone $zone" if $allip && @$interfaceref;
|
fatal_error "Duplicate Host Group ($interface:" . ALLIP . ") in zone $zone" if $allip && @$interfaceref;
|
||||||
|
|
||||||
$zoneref->{options}{complex} = 1 if @$interfaceref || ( @newnetworks > 1 ) || ( @exclusions ) || $options->{routeback};
|
$zoneref->{options}{complex} = 1 if @$interfaceref || @newnetworks > 1 || @exclusions || $options->{routeback};
|
||||||
|
|
||||||
push @{$interfaceref}, { options => $options,
|
push @{$interfaceref}, { options => $options,
|
||||||
hosts => \@newnetworks,
|
hosts => \@newnetworks,
|
||||||
|
Loading…
Reference in New Issue
Block a user