Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions mysql-test/include/check_ipv4_mapped.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Check if IPv6 IPv4 mapped is available.
#
# The real check is done in the suite.pm
# (it has to be done *before* mariadbd is started)
#
1 change: 1 addition & 0 deletions mysql-test/main/resolveip.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
--source include/not_windows.inc
--source include/check_ipv6.inc
--source include/check_ipv4_mapped.inc

# Reverse DNS tests (getnameinfo with NI_NAMEREQD) require:
# - /etc/hosts entries for 127.0.0.1 and ::1 (or working DNS PTR records)
Expand Down
12 changes: 12 additions & 0 deletions mysql-test/suite.pm
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ sub skip_combinations {
}
$skip{'include/check_ipv6.inc'} = 'No IPv6' unless ipv6_ok();

sub ipv4_mapped_ok() {
use Socket;
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 <5.14
eval { bind $sock, sockaddr_in6($::baseport, Socket::inet_pton(Socket::AF_INET6,
'::ffff:127.0.0.1')) };
return $@ eq "" && $! eq ""
}
$skip{'include/check_ipv4_mapped.inc'} = 'No IPv6 -> IPv4 mapped address'
unless ipv4_mapped_ok();

# SSL is complicated
my $ssl_lib= $::mysqld_variables{'version-ssl-library'};
my $openssl_ver= $ssl_lib =~ /OpenSSL (\S+)/ ? $1 : "";
Expand Down