Commit 3febb3ce authored by Sergei Golubchik's avatar Sergei Golubchik

mtr: smarter check for usable ipv6.

Handles the case of
sysctl net.ipv6.conf.all.disable_ipv6=1 net.ipv6.conf.default.disable_ipv6=1
parent 5f1a2cf8
...@@ -30,10 +30,14 @@ sub skip_combinations { ...@@ -30,10 +30,14 @@ sub skip_combinations {
unless $::mysqld_variables{'innodb'} eq "ON"; unless $::mysqld_variables{'innodb'} eq "ON";
# disable tests that use ipv6, if unsupported # disable tests that use ipv6, if unsupported
use Socket; sub ipv6_ok() {
$skip{'include/check_ipv6.inc'} = 'No IPv6' use Socket;
unless socket SOCK, PF_INET6, SOCK_STREAM, getprotobyname('tcp'); return 0 unless socket my $sock, PF_INET6, SOCK_STREAM, getprotobyname('tcp');
close SOCK; # eval{}, if there's no Socket::sockaddr_in6 at all, old Perl installation
eval { connect $sock, sockaddr_in6(7, Socket::IN6ADDR_LOOPBACK) };
return $! != 101;
}
$skip{'include/check_ipv6.inc'} = 'No IPv6' unless ipv6_ok();
%skip; %skip;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment