Skip to content

Commit

Permalink
net: fix dns lookup for android
Browse files Browse the repository at this point in the history
`V4MAPPED` isn't supported by Android either (as of 6.0)

PR-URL: #4580
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
daguej authored and Myles Borins committed Feb 15, 2016
1 parent 26f0240 commit 8ed0c1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -951,12 +951,12 @@ function lookupAndConnect(self, options) {

if (dnsopts.family !== 4 && dnsopts.family !== 6) {
dnsopts.hints = dns.ADDRCONFIG;
// The AI_V4MAPPED hint is not supported on FreeBSD, and getaddrinfo
// The AI_V4MAPPED hint is not supported on FreeBSD or Android, and getaddrinfo
// returns EAI_BADFLAGS. However, it seems to be supported on most other
// systems. See
// http://lists.freebsd.org/pipermail/freebsd-bugs/2008-February/028260.html
// for more information on the lack of support for FreeBSD.
if (process.platform !== 'freebsd')
if (process.platform !== 'freebsd' && process.platform !== 'android')
dnsopts.hints |= dns.V4MAPPED;
}

Expand Down

0 comments on commit 8ed0c1c

Please sign in to comment.