Re-enable list-valued return from validate_4address()

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@9606 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2009-03-05 19:56:24 +00:00
parent 062c7ec822
commit 410e551a69
3 changed files with 9 additions and 4 deletions

View File

@ -143,10 +143,13 @@ sub validate_4address( $$ ) {
unless ( valid_4address $addr ) {
fatal_error "Invalid IP Address ($addr)" unless $allow_name;
fatal_error "Unknown Host ($addr)" unless (defined ( $addr = gethostbyname $addr) );
fatal_error "Unknown Host ($addr)" unless @addrs = gethostbyname( $addr );
if ( defined wantarray ) {
@addrs = ( inet_ntoa( $addr ) );
shift @addrs for (1..4);
for ( @addrs ) {
$_ = ( inet_ntoa( $_ ) );
}
}
}

View File

@ -332,7 +332,8 @@ sub add_a_provider( $$$$$$$$ ) {
$optional = 1;
} elsif ( $option =~ /^src=(.*)$/ ) {
fatal_error "OPTION 'src' not allowed on shared interface" if $shared;
$address = validate_address( $1 , 1 );
my @addresses = validate_address( $1 , 1 );
$address = $addresses[0];
} elsif ( $option =~ /^mtu=(\d+)$/ ) {
$mtu = "mtu $1 ";
} elsif ( $option =~ /^fallback=(\d+)$/ ) {

View File

@ -1319,7 +1319,8 @@ sub process_rule1 ( $$$$$$$$$$$$$ ) {
if ( $server =~ /^(.+)-(.+)$/ ) {
validate_range( $1, $2 );
} else {
$server = validate_address $server, 1;
my @servers = validate_address $server, 1;
$server = join ',', @servers;
}
if ( $action eq 'SAME' ) {