| Index: runtime/bin/socket_android.cc
|
| diff --git a/runtime/bin/socket_android.cc b/runtime/bin/socket_android.cc
|
| index 0aa5968eb5d00eec57bfc8161b0a1895f8eb4018..c08aeddeb57c329d0b93d8459f039e73b889c58c 100644
|
| --- a/runtime/bin/socket_android.cc
|
| +++ b/runtime/bin/socket_android.cc
|
| @@ -222,6 +222,28 @@ AddressList<SocketAddress>* Socket::LookupAddress(const char* host,
|
| }
|
|
|
|
|
| +const char* Socket::ReverseLookup(RawAddr addr, OSError** os_error) {
|
| + char* host = new char[NI_MAXHOST];
|
| + int status = TEMP_FAILURE_RETRY(getnameinfo(
|
| + &addr.addr,
|
| + SocketAddress::GetAddrLength(&addr),
|
| + host,
|
| + NI_MAXHOST,
|
| + NULL,
|
| + 0,
|
| + NI_NAMEREQD));
|
| + if (status != 0) {
|
| + ASSERT(*os_error == NULL);
|
| + *os_error = new OSError(status,
|
| + gai_strerror(status),
|
| + OSError::kGetAddressInfo);
|
| + delete host;
|
| + return NULL;
|
| + }
|
| + return host;
|
| +}
|
| +
|
| +
|
| static bool ShouldIncludeIfaAddrs(struct ifaddrs* ifa, int lookup_family) {
|
| int family = ifa->ifa_addr->sa_family;
|
| if (lookup_family == family) return true;
|
|
|