diff --git a/Shorewall/Perl/Shorewall/IPAddrs.pm b/Shorewall/Perl/Shorewall/IPAddrs.pm index a25589f7b..ebbe2a3b1 100644 --- a/Shorewall/Perl/Shorewall/IPAddrs.pm +++ b/Shorewall/Perl/Shorewall/IPAddrs.pm @@ -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( $_ ) ); + } } } diff --git a/Shorewall/Perl/Shorewall/Providers.pm b/Shorewall/Perl/Shorewall/Providers.pm index 1dbcde1b2..ff808895f 100644 --- a/Shorewall/Perl/Shorewall/Providers.pm +++ b/Shorewall/Perl/Shorewall/Providers.pm @@ -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+)$/ ) { diff --git a/Shorewall/Perl/Shorewall/Rules.pm b/Shorewall/Perl/Shorewall/Rules.pm index 618ee3ba1..f9b3ae3a1 100644 --- a/Shorewall/Perl/Shorewall/Rules.pm +++ b/Shorewall/Perl/Shorewall/Rules.pm @@ -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' ) {