Simplify logic in loopback helper functions

This commit is contained in:
Tom Eastep 2010-07-08 17:11:27 -07:00
parent 8d5f04d5a5
commit 9eca7fb37b

View File

@ -1678,10 +1678,7 @@ sub generate_dest_rules( $$$$ ) {
my $type2 = $z2ref->{type}; my $type2 = $z2ref->{type};
if ( $type2 == VSERVER ) { if ( $type2 == VSERVER ) {
my $dest_hosts_ref = $z2ref->{hosts}; for my $hostref ( @{$z2ref->{hosts}{ip}{'%vserver%'}} ) {
for my $typeref ( values %{$dest_hosts_ref} ) {
for my $hostref ( @{$typeref->{'%vserver%'}} ) {
my $exclusion = dest_exclusion( $hostref->{exclusions}, $chain); my $exclusion = dest_exclusion( $hostref->{exclusions}, $chain);
for my $net ( @{$hostref->{hosts}} ) { for my $net ( @{$hostref->{hosts}} ) {
@ -1691,7 +1688,6 @@ sub generate_dest_rules( $$$$ ) {
join('', $match, match_dest_net( $net ) ) ) join('', $match, match_dest_net( $net ) ) )
} }
} }
}
} else { } else {
add_jump( $chainref, $chain, 0, $match ); add_jump( $chainref, $chain, 0, $match );
} }
@ -1708,10 +1704,7 @@ sub generate_source_rules( $$$$ ) {
# #
# Not a CONTINUE policy with no rules # Not a CONTINUE policy with no rules
# #
my $source_hosts_ref = defined_zone( $z1 )->{hosts}; for my $hostref ( @{defined_zone( $z1 )->{hosts}{ip}{'%vserver%'}} ) {
for my $typeref ( values %{$source_hosts_ref} ) {
for my $hostref ( @{$typeref->{'%vserver%'}} ) {
my $ipsec_match = match_ipsec_in $z1 , $hostref; my $ipsec_match = match_ipsec_in $z1 , $hostref;
my $exclusion = source_exclusion( $hostref->{exclusions}, $chain); my $exclusion = source_exclusion( $hostref->{exclusions}, $chain);
@ -1724,7 +1717,6 @@ sub generate_source_rules( $$$$ ) {
} }
} }
} }
}
} }
# #