Query libnetd_client for the appropriate netId for host resolution.
If libnetd_client can't be found, operate as before and use the default netId
potentially overriden by a more specific netId passed in to
android_get*fornet().
(cherry picked from commit 559c7842cc6862568d9b5799fc0bcf74d58b596b)
Change-Id: I42ef3293172651870fb46d2de22464c4f03e8e0b
diff --git a/libc/dns/net/getaddrinfo.c b/libc/dns/net/getaddrinfo.c
index 4c120d9..be692e3 100644
--- a/libc/dns/net/getaddrinfo.c
+++ b/libc/dns/net/getaddrinfo.c
@@ -92,6 +92,7 @@
#include <ctype.h>
#include <errno.h>
#include <netdb.h>
+#include "NetdClientDispatch.h"
#include "resolv_cache.h"
#include "resolv_netid.h"
#include "resolv_private.h"
@@ -449,6 +450,8 @@
return EAI_NODATA;
}
+ netid = __netdClientDispatch.netIdForResolv(netid);
+
// Send the request.
proxy = fdopen(sock, "r+");
if (fprintf(proxy, "getaddrinfo %s %s %d %d %d %d %u",