dns: remove AI_V4MAPPED hint flag on FreeBSD

FreeBSD does not support V4MAPPED.

PR-URL: https://github.com/iojs/io.js/pull/332
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
Fedor Indutny 2015-01-13 16:16:15 +03:00
parent b949437c00
commit 04bea9f9c2

View File

@ -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;
}