| Index: runtime/bin/socket_win.cc
|
| diff --git a/runtime/bin/socket_win.cc b/runtime/bin/socket_win.cc
|
| index da82b273b68ec6385beeb2252cec366a395d6706..7f1de2d94c4b97994551d90f09514306bad348db 100644
|
| --- a/runtime/bin/socket_win.cc
|
| +++ b/runtime/bin/socket_win.cc
|
| @@ -233,11 +233,17 @@ AddressList<SocketAddress>* Socket::LookupAddress(const char* host,
|
| memset(&hints, 0, sizeof(hints));
|
| hints.ai_family = SocketAddress::FromType(type);
|
| hints.ai_socktype = SOCK_STREAM;
|
| - hints.ai_flags = 0;
|
| + hints.ai_flags = (AI_V4MAPPED | AI_ADDRCONFIG);
|
| hints.ai_protocol = IPPROTO_TCP;
|
| struct addrinfo* info = NULL;
|
| int status = getaddrinfo(host, 0, &hints, &info);
|
| if (status != 0) {
|
| + // We failed, try without AI_ADDRCONFIG. This can happen when looking up
|
| + // e.g. '::1', when there are no global IPv6 addresses.
|
| + hints.ai_flags = AI_V4MAPPED;
|
| + status = getaddrinfo(host, 0, &hints, &info);
|
| + }
|
| + if (status != 0) {
|
| ASSERT(*os_error == NULL);
|
| DWORD error_code = WSAGetLastError();
|
| SetLastError(error_code);
|
|
|