aboutsummaryrefslogtreecommitdiffstats
path: root/libc/netbsd/net/getaddrinfo.c
diff options
context:
space:
mode:
authorRobert Greenwalt <rgreenwalt@google.com>2013-08-24 12:35:08 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2013-08-24 12:35:08 +0000
commitc6135ba76db027d85751f84bf648a865609c0e1b (patch)
treebcdbe18c8f83df14995512955341223acdce4c23 /libc/netbsd/net/getaddrinfo.c
parent41f08abf3d020ad8b48ff4151f8c623a119790e0 (diff)
parenta31ddef36df7970db1145f7ae66060f8e3eebf3f (diff)
downloadandroid_bionic-c6135ba76db027d85751f84bf648a865609c0e1b.tar.gz
android_bionic-c6135ba76db027d85751f84bf648a865609c0e1b.tar.bz2
android_bionic-c6135ba76db027d85751f84bf648a865609c0e1b.zip
Merge "Change how DNS resolver handle no default iface"
Diffstat (limited to 'libc/netbsd/net/getaddrinfo.c')
-rw-r--r--libc/netbsd/net/getaddrinfo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libc/netbsd/net/getaddrinfo.c b/libc/netbsd/net/getaddrinfo.c
index c4766e406..0d1949d15 100644
--- a/libc/netbsd/net/getaddrinfo.c
+++ b/libc/netbsd/net/getaddrinfo.c
@@ -1874,10 +1874,10 @@ static bool _using_default_dns(const char *iface)
if (iface == NULL || *iface == '\0') return true;
if_len = _resolv_get_default_iface(buf, sizeof(buf));
- if (if_len + 1 <= sizeof(buf)) {
- if (strcmp(buf, iface) != 0) return false;
+ if (if_len != 0 && if_len + 1 <= sizeof(buf)) {
+ if (strcmp(buf, iface) == 0) return true;
}
- return true;
+ return false;
}
/*ARGSUSED*/