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 <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
daguej authored and jasnell committed Jan 8, 2016
1 parent fde18b2 commit c64018e
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 @@ -953,12 +953,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 c64018e

Please sign in to comment.