summaryrefslogtreecommitdiffstats
path: root/luni/src/main/native
diff options
context:
space:
mode:
Diffstat (limited to 'luni/src/main/native')
-rw-r--r--luni/src/main/native/java_net_InetAddress.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/luni/src/main/native/java_net_InetAddress.cpp b/luni/src/main/native/java_net_InetAddress.cpp
index 84c9751..cf026bc 100644
--- a/luni/src/main/native/java_net_InetAddress.cpp
+++ b/luni/src/main/native/java_net_InetAddress.cpp
@@ -104,11 +104,16 @@ static jobjectArray getAllByNameUsingDns(JNIEnv* env, const char* name,
memset(&hints, 0, sizeof(hints));
/*
+ * IPv4 only for now until the socket code supports IPv6; otherwise, the
+ * resolver will create two separate requests, one for IPv4 and one,
+ * currently unnecessary, for IPv6.
+ */
+ hints.ai_family = AF_INET;
+ /*
* If we don't specify a socket type, every address will appear twice, once
* for SOCK_STREAM and one for SOCK_DGRAM. Since we do not return the family
* anyway, just pick one.
*/
- hints.ai_family = preferIPv4Stack ? AF_INET : AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
int result = getaddrinfo(name, NULL, &hints, &addressList);