mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-16 03:10:39 +01:00
Fix host list exclusion
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6116 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
7db77a4b22
commit
86690a049e
@ -105,6 +105,10 @@ sub validate_hosts_file()
|
||||
$optionsref = \%options;
|
||||
}
|
||||
|
||||
fatal_error "Invalid hosts list" if $hosts =~ /,!/;
|
||||
|
||||
$hosts =~ s/!/,!/g;
|
||||
|
||||
add_group_to_zone( $zone, $type , $interface, [ split ',', $hosts ] , $optionsref);
|
||||
|
||||
progress_message " Host \"$line\" validated";
|
||||
|
@ -84,6 +84,7 @@ sub add_group_to_zone($$$$$)
|
||||
if ( $host =~ /^!.*/ ) {
|
||||
fatal_error "Invalid host group: @$networks" if $switched;
|
||||
$switched = 1;
|
||||
$host =~ s/^!//;
|
||||
$new = \@exclusions;
|
||||
}
|
||||
|
||||
|
@ -1335,7 +1335,7 @@ sub generate_matrix() {
|
||||
|
||||
for my $host ( @{$exclusionsref} ) {
|
||||
my ( $interface, $net ) = split /:/, $host;
|
||||
insert_rule $chainref , $num++, join( '', "-i $interface ", match_source_net( $host ), '-j RETURN' );
|
||||
insert_rule $chainref , $num++, join( '', "-i $interface ", match_source_net( $net ), '-j RETURN' );
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user