Commit 0bae1957 authored by Sergei Golubchik's avatar Sergei Golubchik

simplify the ipv6 check

parent 70dcb46e
...@@ -56,15 +56,10 @@ sub skip_combinations { ...@@ -56,15 +56,10 @@ 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');
my $ipv6_works = false; $!="";
# eval{}, if there's no Socket::sockaddr_in6 at all, old Perl installation <5.14 # eval{}, if there's no Socket::sockaddr_in6 at all, old Perl installation <5.14
eval { eval { bind $sock, sockaddr_in6($::baseport, Socket::IN6ADDR_LOOPBACK) };
my $addr = sockaddr_in6($baseport, Socket::IN6ADDR_LOOPBACK) or return 0; return $@ eq "" && $! eq ""
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();
......
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