mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-08 16:54:10 +01:00
Fix bug reported by Steven Springl
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@8231 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
131acd8e1f
commit
aec4134aa1
@ -1824,9 +1824,8 @@ sub expand_rule( $$$$$$$$$$ )
|
||||
# ADDRESS 'detect' in the masq file.
|
||||
#
|
||||
fatal_error "Bridge port ($diface) not allowed" if port_to_bridge( $diface );
|
||||
add_command( $chainref , 'for dest in ' . get_interface_addresses( $diface) . '; do' );
|
||||
push_command( $chainref , 'for dest in ' . get_interface_addresses( $diface) . '; do', 'done' );
|
||||
$rule .= '-d $dest ';
|
||||
incr_cmd_level $chainref;
|
||||
} else {
|
||||
fatal_error "Bridge Port ($diface) not allowed in OUTPUT or POSTROUTING rules" if ( $restriction & ( POSTROUTE_RESTRICT + OUTPUT_RESTRICT ) ) && port_to_bridge( $diface );
|
||||
fatal_error "Destination Interface ($diface) not allowed when the destination zone is the firewall zone" if $restriction & INPUT_RESTRICT;
|
||||
|
@ -177,13 +177,13 @@ sub ip_range_explicit( $ ) {
|
||||
@result;
|
||||
}
|
||||
|
||||
sub validate_host( $ ) {
|
||||
my $host = $_[0];
|
||||
sub validate_host( $$ ) {
|
||||
my ( $host, $allow_name ) = $_[0];
|
||||
|
||||
if ( $host =~ /^(\d+\.\d+\.\d+\.\d+)-(\d+\.\d+\.\d+\.\d+)$/ ) {
|
||||
validate_range $1, $2;
|
||||
} else {
|
||||
validate_net( $host, 0 );
|
||||
validate_net( $host, $allow_name );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -177,7 +177,7 @@ sub setup_ecn()
|
||||
$hosts = ALLIPv4 if $hosts eq '-';
|
||||
|
||||
for my $host( split_list $hosts, 'address' ) {
|
||||
validate_net( $host , 1 );
|
||||
validate_host( $host , 1 );
|
||||
push @hosts, [ $interface, $host ];
|
||||
}
|
||||
}
|
||||
@ -358,7 +358,7 @@ sub process_criticalhosts() {
|
||||
my @hosts;
|
||||
|
||||
for my $host ( split_list $hosts, 'host' ) {
|
||||
validate_net $host, 1;
|
||||
validate_host $host, 1;
|
||||
push @hosts, "$interface:$host";
|
||||
}
|
||||
|
||||
@ -399,7 +399,7 @@ sub process_routestopped() {
|
||||
my @hosts;
|
||||
|
||||
for my $host ( split /,/, $hosts ) {
|
||||
validate_net $host, 1;
|
||||
validate_host $host, 1;
|
||||
push @hosts, "$interface:$host";
|
||||
}
|
||||
|
||||
|
@ -488,7 +488,7 @@ sub add_group_to_zone($$$$$)
|
||||
if ( substr( $host, 0, 1 ) eq '+' ) {
|
||||
fatal_error "Invalid ipset name ($host)" unless $host =~ /^\+[a-zA-Z]\w*$/;
|
||||
} else {
|
||||
validate_host $host;
|
||||
validate_host $host, 0;
|
||||
}
|
||||
|
||||
push @$new, $switched ? "$interface:$host" : $host;
|
||||
|
Loading…
Reference in New Issue
Block a user