Skip to content

Commit 04bea9f

Browse files
committed
dns: remove AI_V4MAPPED hint flag on FreeBSD
FreeBSD does not support V4MAPPED. PR-URL: nodejs#332 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent b949437 commit 04bea9f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/dns.js

+5
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ exports.lookup = function lookup(hostname, options, callback) {
106106
hints !== (exports.ADDRCONFIG | exports.V4MAPPED)) {
107107
throw new TypeError('invalid argument: hints must use valid flags');
108108
}
109+
110+
// FIXME(indutny): V4MAPPED on FreeBSD results in EAI_BADFLAGS, because
111+
// the libc does not support it
112+
if (process.platform === 'freebsd' && family !== 6)
113+
hints &= ~exports.V4MAPPED;
109114
} else {
110115
family = options >>> 0;
111116
}

0 commit comments

Comments
 (0)