mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
simplify the ipv6 check
This commit is contained in:
parent
70dcb46e98
commit
0bae1957dd
1 changed files with 3 additions and 8 deletions
|
@ -56,15 +56,10 @@ sub skip_combinations {
|
|||
sub ipv6_ok() {
|
||||
use Socket;
|
||||
return 0 unless socket my $sock, PF_INET6, SOCK_STREAM, getprotobyname('tcp');
|
||||
my $ipv6_works = false;
|
||||
$!="";
|
||||
# eval{}, if there's no Socket::sockaddr_in6 at all, old Perl installation <5.14
|
||||
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;
|
||||
eval { bind $sock, sockaddr_in6($::baseport, Socket::IN6ADDR_LOOPBACK) };
|
||||
return $@ eq "" && $! eq ""
|
||||
}
|
||||
$skip{'include/check_ipv6.inc'} = 'No IPv6' unless ipv6_ok();
|
||||
|
||||
|
|
Loading…
Reference in a new issue