# HG changeset patch
# Parent e817b51d075737a1652e0b5630c8823a4b074cec
Restore HAVE_INET6 tests (PR libgcj/52645)
@@ -655,6 +655,7 @@ gnu::java::net::PlainDatagramSocketImpl:
len = sizeof (struct in_addr);
ptr = (const char *) &u.addr;
}
+#ifdef HAVE_INET6
else if (len == 16)
{
level = IPPROTO_IPV6;
@@ -663,6 +664,7 @@ gnu::java::net::PlainDatagramSocketImpl:
len = sizeof (struct in6_addr);
ptr = (const char *) &u.addr6;
}
+#endif
else
throw
new ::java::net::SocketException (JvNewStringUTF ("invalid length"));
@@ -540,6 +540,7 @@ gnu::java::net::PlainDatagramSocketImpl:
len = sizeof (struct in_addr);
ptr = (const char *) &u.addr;
}
+#ifdef HAVE_INET6
else if (len == 16)
{
level = IPPROTO_IPV6;
@@ -548,6 +549,7 @@ gnu::java::net::PlainDatagramSocketImpl:
len = sizeof (struct in6_addr);
ptr = (const char *) &u.addr6;
}
+#endif
else
throw
new ::java::net::SocketException (JvNewStringUTF ("invalid length"));
@@ -635,14 +637,14 @@ gnu::java::net::PlainDatagramSocketImpl:
goto error;
if (u.address.sin_family == AF_INET)
{
- laddr = JvNewByteArray (4);
- memcpy (elements (laddr), &u.address.sin_addr, 4);
+ laddr = JvNewByteArray (4);
+ memcpy (elements (laddr), &u.address.sin_addr, 4);
}
#ifdef HAVE_INET6
- else if (u.address.sin_family == AF_INET6)
+ else if (u.address.sin_family == AF_INET6)
{
- laddr = JvNewByteArray (16);
- memcpy (elements (laddr), &u.address6.sin6_addr, 16);
+ laddr = JvNewByteArray (16);
+ memcpy (elements (laddr), &u.address6.sin6_addr, 16);
}
#endif
else