From 1896e56894018543253bb046ebef686715fa7c50 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Sun, 19 Feb 2012 08:39:17 -0800 Subject: [PATCH] Rework some newbie code in add_group_to_zone() Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Zones.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Zones.pm b/Shorewall/Perl/Shorewall/Zones.pm index 2d8393a0d..5ac4756c2 100644 --- a/Shorewall/Perl/Shorewall/Zones.pm +++ b/Shorewall/Perl/Shorewall/Zones.pm @@ -403,7 +403,7 @@ sub parse_zone_option_list($$\$$) # # 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( $ ) { my $zoneref = shift; @@ -769,13 +769,13 @@ sub add_group_to_zone($$$$$) my $gtype = $type & IPSEC ? 'ipsec' : 'ip'; - $hostsref = ( $zoneref->{hosts} || ( $zoneref->{hosts} = {} ) ); - $typeref = ( $hostsref->{$gtype} || ( $hostsref->{$gtype} = {} ) ); - $interfaceref = ( $typeref->{$interface} || ( $typeref->{$interface} = [] ) ); + $hostsref = ( $zoneref->{hosts} ||= {} ); + $typeref = ( $hostsref->{$gtype} ||= {} ); + $interfaceref = ( $typeref->{$interface} ||= [] ); 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, hosts => \@newnetworks,