mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-15 10:51:02 +01:00
Make find_hosts_by_option() work with options specified on the interface
This commit is contained in:
parent
db8dba66db
commit
f2ca9e25c9
@ -641,7 +641,9 @@ sub add_group_to_zone($$$$$)
|
||||
my $allip = 0;
|
||||
|
||||
for my $host ( @$networks ) {
|
||||
$interfaces{$interface}{nets}++;
|
||||
$interfaceref = $interfaces{$interface};
|
||||
|
||||
$interfaceref->{nets}++;
|
||||
|
||||
fatal_error "Invalid Host List" unless defined $host and $host ne '';
|
||||
|
||||
@ -658,6 +660,13 @@ sub add_group_to_zone($$$$$)
|
||||
if ( $host eq ALLIP ) {
|
||||
fatal_error "Duplicate Host Group ($interface:$host) in zone $zone" if @newnetworks;
|
||||
$interfaces{$interface}{zone} = $zone;
|
||||
#
|
||||
# Make 'find_hosts_by_option()' work correctly for this zone
|
||||
#
|
||||
for ( qw/blacklist maclist nosmurfs tcpflags/ ) {
|
||||
$options->{$_} = 1 if $interfaceref->{options}{$_};
|
||||
}
|
||||
|
||||
$allip = 1;
|
||||
}
|
||||
}
|
||||
@ -1663,7 +1672,7 @@ sub find_hosts_by_option( $ ) {
|
||||
}
|
||||
|
||||
for my $interface ( @interfaces ) {
|
||||
if ( ! $interfaces{$interface}{zone} && $interfaces{$interface}{options}{$option} ) {
|
||||
if ( ( ! $interfaces{$interface}{zone} ) && $interfaces{$interface}{options}{$option} ) {
|
||||
push @hosts, [ $interface, 'none', ALLIP , [] ];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user