diff options
-rw-r--r-- | ext/Socket/Socket.xs | 10 | ||||
-rw-r--r-- | ext/Socket/t/Socket.t | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/ext/Socket/Socket.xs b/ext/Socket/Socket.xs index 387965e8b8..ef2778b10c 100644 --- a/ext/Socket/Socket.xs +++ b/ext/Socket/Socket.xs @@ -672,9 +672,9 @@ pack_sockaddr_in6(port, sin6_addr, scope_id=0, flowinfo=0) sin6.sin6_port = htons(port); sin6.sin6_flowinfo = htonl(flowinfo); Copy(addrbytes, &sin6.sin6_addr, sizeof(sin6.sin6_addr), char); -#if !defined(__GLIBC__) || (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) +# ifdef HAS_SIN6_SCOPE_ID sin6.sin6_scope_id = scope_id; -#endif +# endif # ifdef HAS_SOCKADDR_SA_LEN sin6.sin6_len = sizeof(sin6); # endif @@ -705,11 +705,11 @@ unpack_sockaddr_in6(sin6_sv) EXTEND(SP, 4); mPUSHi(ntohs(sin6.sin6_port)); mPUSHp((char *)&sin6.sin6_addr, sizeof(sin6.sin6_addr)); -#if !defined(__GLIBC__) || (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) +# ifdef HAS_SIN6_SCOPE_ID mPUSHi(sin6.sin6_scope_id); -#else +# else mPUSHi(0); -#endif +# endif mPUSHi(ntohl(sin6.sin6_flowinfo)); #else ST(0) = (SV*)not_here("pack_sockaddr_in6"); diff --git a/ext/Socket/t/Socket.t b/ext/Socket/t/Socket.t index 3cfd840e73..d289f103a4 100644 --- a/ext/Socket/t/Socket.t +++ b/ext/Socket/t/Socket.t @@ -186,7 +186,7 @@ if($Config{d_inetntop} && $Config{d_inetaton}){ } if(defined eval { AF_INET6() } ) { - my $sin6 = pack_sockaddr_in6(0x1234, "0123456789abcdef", 567, 89); + my $sin6 = pack_sockaddr_in6(0x1234, "0123456789abcdef", 0, 89); print "not " unless sockaddr_family($sin6) == AF_INET6; print "ok 22\n"; @@ -197,7 +197,7 @@ if(defined eval { AF_INET6() } ) { print "not " unless (unpack_sockaddr_in6($sin6))[1] == "0123456789abcdef"; print "ok 24\n"; - print "not " unless (unpack_sockaddr_in6($sin6))[2] == 567; + print "not " unless (unpack_sockaddr_in6($sin6))[2] == 0; print "ok 25\n"; print "not " unless (unpack_sockaddr_in6($sin6))[3] == 89; |