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:
teastep 2007-04-25 16:26:16 +00:00
parent 7db77a4b22
commit 86690a049e
3 changed files with 6 additions and 1 deletions

View File

@ -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";

View File

@ -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;
}

View File

@ -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' );
}
}