Skip to content

Commit

Permalink
dns: remove AI_V4MAPPED hint flag on FreeBSD
Browse files Browse the repository at this point in the history
FreeBSD does not support V4MAPPED.

PR-URL: #332
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information
indutny committed Jan 13, 2015
1 parent b949437 commit 04bea9f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/dns.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ exports.lookup = function lookup(hostname, options, callback) {
hints !== (exports.ADDRCONFIG | exports.V4MAPPED)) {
throw new TypeError('invalid argument: hints must use valid flags');
}

// FIXME(indutny): V4MAPPED on FreeBSD results in EAI_BADFLAGS, because
// the libc does not support it
if (process.platform === 'freebsd' && family !== 6)
hints &= ~exports.V4MAPPED;
} else {
family = options >>> 0;
}
Expand Down

0 comments on commit 04bea9f

Please sign in to comment.