Subject: | Cache-Memcached-1.29: perl 5.12 changes break IPv6 detection |
Perl 5.12 appears to have moved AF_INET6 and PF_INET6 constants into
Socket.pm and conditionally out of Socket6.pm if Socket.pm exports them.
This breaks Cache::Memcached's detection of IPv6 support. Patch is
included below.
Thanks
# diff -u Memcached.pm Memcached.fixed.pm
--- Memcached.pm 2010-11-23 12:01:45.000000000 -0700
+++ Memcached.fixed.pm 2010-11-23 12:02:54.000000000 -0700
@@ -37,11 +37,11 @@
use constant COMPRESS_SAVINGS => 0.20; # percent
use vars qw($VERSION $HAVE_ZLIB $FLAG_NOSIGNAL $HAVE_SOCKET6);
-$VERSION = "1.29";
+$VERSION = "1.29.4663";
BEGIN {
$HAVE_ZLIB = eval "use Compress::Zlib (); 1;";
- $HAVE_SOCKET6 = eval "use Socket6 qw(AF_INET6 PF_INET6); 1;";
+ $HAVE_SOCKET6 = eval "use Socket qw(AF_INET6 PF_INET6); use Socket6
qw(inet_pton pack_sockaddr_in6); 1;" || eval "use Socket6 qw(AF_INET6
PF_INET6 inet_pton pack_sockaddr_in6); 1;";
}
my $HAVE_XS = eval "use Cache::Memcached::GetParserXS; 1;";
@@ -256,8 +256,8 @@
no strict 'subs'; # for PF_INET6 and AF_INET6, weirdly
imported
socket($sock, PF_INET6, SOCK_STREAM, $proto);
$sock_map{$sock} = $host;
- $sin = Socket6::pack_sockaddr_in6($port,
-
Socket6::inet_pton(AF_INET6, $prefip));
+ $sin = pack_sockaddr_in6($port,
+ inet_pton(AF_INET6,
$prefip));
} else {
socket($sock, PF_INET, SOCK_STREAM, $proto);
$sock_map{$sock} = $host;
@@ -280,8 +280,8 @@
no strict 'subs'; # for PF_INET6 and AF_INET6, weirdly
imported
socket($sock, PF_INET6, SOCK_STREAM, $proto);
$sock_map{$sock} = $host;
- $sin = Socket6::pack_sockaddr_in6($port,
-
Socket6::inet_pton(AF_INET6, $ip));
+ $sin = pack_sockaddr_in6($port,
+ inet_pton(AF_INET6,
$ip));
} else {
socket($sock, PF_INET, SOCK_STREAM, $proto);
$sock_map{$sock} = $host;