f7ef4c2ed4
[Peter: squash 'add hash' patch into it] Signed-off-by: Francois Perrad <francois.perrad@gadz.org> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
62 lines
1.9 KiB
Diff
62 lines
1.9 KiB
Diff
fix on uClibc without IPv6 support
|
|
|
|
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
|
|
|
|
Index: b/cpan/Socket/Socket.xs
|
|
===================================================================
|
|
--- a/cpan/Socket/Socket.xs
|
|
+++ b/cpan/Socket/Socket.xs
|
|
@@ -920,7 +920,7 @@
|
|
CODE:
|
|
#ifdef HAS_INETNTOP
|
|
STRLEN addrlen;
|
|
-#ifdef AF_INET6
|
|
+#if (defined(__UCLIBC__) && defined(__UCLIBC_HAS_IPV6__)) || (!defined(__UCLIBC__) && defined(AF_INET6))
|
|
struct in6_addr addr;
|
|
char str[INET6_ADDRSTRLEN];
|
|
#else
|
|
@@ -940,7 +940,7 @@
|
|
croak("Bad address length for Socket::inet_ntop on AF_INET;"
|
|
" got %"UVuf", should be 4", (UV)addrlen);
|
|
break;
|
|
-#ifdef AF_INET6
|
|
+#if (defined(__UCLIBC__) && defined(__UCLIBC_HAS_IPV6__)) || (!defined(__UCLIBC__) && defined(AF_INET6))
|
|
case AF_INET6:
|
|
if(addrlen != 16)
|
|
croak("Bad address length for Socket::inet_ntop on AF_INET6;"
|
|
@@ -949,7 +949,7 @@
|
|
#endif
|
|
default:
|
|
croak("Bad address family for %s, got %d, should be"
|
|
-#ifdef AF_INET6
|
|
+#if (defined(__UCLIBC__) && defined(__UCLIBC_HAS_IPV6__)) || (!defined(__UCLIBC__) && defined(AF_INET6))
|
|
" either AF_INET or AF_INET6",
|
|
#else
|
|
" AF_INET",
|
|
@@ -979,7 +979,7 @@
|
|
#ifdef HAS_INETPTON
|
|
int ok;
|
|
int addrlen = 0;
|
|
-#ifdef AF_INET6
|
|
+#if (defined(__UCLIBC__) && defined(__UCLIBC_HAS_IPV6__)) || (!defined(__UCLIBC__) && defined(AF_INET6))
|
|
struct in6_addr ip_address;
|
|
#else
|
|
struct in_addr ip_address;
|
|
@@ -989,14 +989,14 @@
|
|
case AF_INET:
|
|
addrlen = 4;
|
|
break;
|
|
-#ifdef AF_INET6
|
|
+#if (defined(__UCLIBC__) && defined(__UCLIBC_HAS_IPV6__)) || (!defined(__UCLIBC__) && defined(AF_INET6))
|
|
case AF_INET6:
|
|
addrlen = 16;
|
|
break;
|
|
#endif
|
|
default:
|
|
croak("Bad address family for %s, got %d, should be"
|
|
-#ifdef AF_INET6
|
|
+#if (defined(__UCLIBC__) && defined(__UCLIBC_HAS_IPV6__)) || (!defined(__UCLIBC__) && defined(AF_INET6))
|
|
" either AF_INET or AF_INET6",
|
|
#else
|
|
" AF_INET",
|