mirror of
https://github.com/MariaDB/server.git
synced 2025-07-07 06:01:31 +03:00
MDEV-9185: fix ipv6 detection test in MTR
Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
This commit is contained in:
committed by
Sergei Golubchik
parent
4f919beeda
commit
70dcb46e98
@ -277,7 +277,7 @@ my $current_config_name; # The currently running config file template
|
|||||||
our @opt_experimentals;
|
our @opt_experimentals;
|
||||||
our $experimental_test_cases= [];
|
our $experimental_test_cases= [];
|
||||||
|
|
||||||
my $baseport;
|
our $baseport;
|
||||||
# $opt_build_thread may later be set from $opt_port_base
|
# $opt_build_thread may later be set from $opt_port_base
|
||||||
my $opt_build_thread= $ENV{'MTR_BUILD_THREAD'} || "auto";
|
my $opt_build_thread= $ENV{'MTR_BUILD_THREAD'} || "auto";
|
||||||
my $opt_port_base= $ENV{'MTR_PORT_BASE'} || "auto";
|
my $opt_port_base= $ENV{'MTR_PORT_BASE'} || "auto";
|
||||||
|
@ -56,9 +56,15 @@ sub skip_combinations {
|
|||||||
sub ipv6_ok() {
|
sub ipv6_ok() {
|
||||||
use Socket;
|
use Socket;
|
||||||
return 0 unless socket my $sock, PF_INET6, SOCK_STREAM, getprotobyname('tcp');
|
return 0 unless socket my $sock, PF_INET6, SOCK_STREAM, getprotobyname('tcp');
|
||||||
# eval{}, if there's no Socket::sockaddr_in6 at all, old Perl installation
|
my $ipv6_works = false;
|
||||||
eval { connect $sock, sockaddr_in6(7, Socket::IN6ADDR_LOOPBACK) };
|
# eval{}, if there's no Socket::sockaddr_in6 at all, old Perl installation <5.14
|
||||||
return $@ eq "";
|
eval {
|
||||||
|
my $addr = sockaddr_in6($baseport, Socket::IN6ADDR_LOOPBACK) or return 0;
|
||||||
|
die 'bind failed' unless bind $sock, $addr;
|
||||||
|
close $sock;
|
||||||
|
$ipv6_works = true;
|
||||||
|
};
|
||||||
|
return $@ eq "" && $ipv6_works;
|
||||||
}
|
}
|
||||||
$skip{'include/check_ipv6.inc'} = 'No IPv6' unless ipv6_ok();
|
$skip{'include/check_ipv6.inc'} = 'No IPv6' unless ipv6_ok();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user