aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2011-09-29 10:52:23 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-09-29 10:52:23 -0700
commit229ab1a33ea79fcea42302fbe9680a6c1047325f (patch)
tree4bcab1fb59b3633dae576cc3320a96dcb9f8332f
parent4638822fc07aae8cc08600c85c16183ed8d5ef79 (diff)
parentf432de2de7288c0589d1e50c2aa949a76c571794 (diff)
downloadbionic-229ab1a33ea79fcea42302fbe9680a6c1047325f.tar.gz
Merge "Send both A and AAAA queries if all probes fail."
-rw-r--r--libc/netbsd/net/getaddrinfo.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libc/netbsd/net/getaddrinfo.c b/libc/netbsd/net/getaddrinfo.c
index cf0503604..ace8c1a4a 100644
--- a/libc/netbsd/net/getaddrinfo.c
+++ b/libc/netbsd/net/getaddrinfo.c
@@ -1911,6 +1911,13 @@ _dns_getaddrinfo(void *rv, void *cb_data, va_list ap)
if (pai->ai_flags & AI_ADDRCONFIG) {
query_ipv6 = _have_ipv6();
query_ipv4 = _have_ipv4();
+ if (query_ipv6 == 0 && query_ipv4 == 0) {
+ // Both our IPv4 and IPv6 connectivity probes failed, which indicates
+ // that we have neither an IPv4 or an IPv6 default route (and thus no
+ // global IPv4 or IPv6 connectivity). We might be in a walled garden.
+ // Throw up our arms and ask for both A and AAAA.
+ query_ipv6 = query_ipv4 = 1;
+ }
}
if (query_ipv6) {
q.qtype = T_AAAA;