mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-16 03:10:39 +01:00
Correct nested Zone sort order
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5466 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
e3f9325a70
commit
70a60971dc
@ -135,6 +135,7 @@ my $line; # Current config file line
|
||||
|
||||
my @zones;
|
||||
my %zones;
|
||||
my %zone_children;
|
||||
my %zone_parents;
|
||||
my %zone_hosts;
|
||||
my %zone_options;
|
||||
@ -399,6 +400,7 @@ sub parse_zone_option_list($)
|
||||
# Parse the zones file. Generates the following information:
|
||||
#
|
||||
# zones => <zone type>
|
||||
# zone_children => <Ref to Empty List>
|
||||
# zone_parents => <List of parent zones>
|
||||
# zone_options => in_out => mss => <mss value>
|
||||
# => ipsec => "ipsec selection string"
|
||||
@ -430,6 +432,7 @@ sub determine_zones()
|
||||
fatal_error "Invalid Parent List ($2)" unless $p;
|
||||
fatal_error "Unknown parent zone ($p)" unless $zones{$p};
|
||||
fatal_error 'Subzones of firewall zone not allowed' if $zones{$p} eq 'firewall';
|
||||
push @{$zone_children{$p}}, $zone;
|
||||
}
|
||||
}
|
||||
|
||||
@ -468,6 +471,7 @@ sub determine_zones()
|
||||
$zone_options{$zone} = \%zone_hash;
|
||||
|
||||
$zone_interfaces{$zone} = {};
|
||||
$zone_children{$zone} = [];
|
||||
|
||||
push @z, $zone;
|
||||
}
|
||||
@ -483,8 +487,8 @@ sub determine_zones()
|
||||
ZONE:
|
||||
for my $zone ( @z ) {
|
||||
unless ( $ordered{$zone} ) {
|
||||
for my $parent ( @{$zone_parents{$zone}} ) {
|
||||
next ZONE unless $ordered{$parent};
|
||||
for my $child ( @{$zone_children{$zone}} ) {
|
||||
next ZONE unless $ordered{$child};
|
||||
}
|
||||
$ordered{$zone} = 1;
|
||||
push @zones, $zone;
|
||||
|
Loading…
Reference in New Issue
Block a user