mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-15 12:14:32 +01:00
Improve handling of ipsec zones
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6273 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
fac8d4cd25
commit
ab7c4200b1
@ -125,11 +125,11 @@ sub validate_hosts_file()
|
||||
progress_message " Host \"$line\" validated";
|
||||
}
|
||||
|
||||
$capabilities{POLICY_MATCH} = '' unless $ipsec or $zones{ipsec};
|
||||
$capabilities{POLICY_MATCH} = '' unless $ipsec || ipseczones;
|
||||
}
|
||||
#
|
||||
# Returns a reference to a array of host entries. Each entry is a
|
||||
# reference to an array containing ( interface , group type {ipsec|none} , network );
|
||||
# reference to an array containing ( interface , polciy match type {ipsec|none} , network );
|
||||
#
|
||||
sub find_hosts_by_option( $ ) {
|
||||
my $option = $_[0];
|
||||
@ -141,7 +141,7 @@ sub find_hosts_by_option( $ ) {
|
||||
for my $host ( @{$arrayref} ) {
|
||||
if ( $host->{options}{$option} ) {
|
||||
for my $net ( @{$host->{hosts}} ) {
|
||||
push @hosts, [ $interface, $type eq 'ipsec4' ? 'ipsec' : 'none' , $net ];
|
||||
push @hosts, [ $interface, $host->{ipsec} , $net ];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ our @EXPORT = qw( NOTHING
|
||||
determine_zones
|
||||
zone_report
|
||||
dump_zone_contents
|
||||
ipseczones
|
||||
|
||||
@zones
|
||||
%zones
|
||||
@ -282,6 +283,17 @@ sub determine_zones()
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Return true of we have any ipsec zones
|
||||
#
|
||||
sub ipseczones() {
|
||||
for my $zoneref ( values %zones ) {
|
||||
return 1 if $zoneref->{type} eq 'ipsec4';
|
||||
}
|
||||
|
||||
0;
|
||||
}
|
||||
|
||||
#
|
||||
# Report about zones.
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user