aboutsummaryrefslogtreecommitdiff
path: root/libc/netbsd/net/getaddrinfo.c
diff options
context:
space:
mode:
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 8c1a01b5d..937c42350 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*/