Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

dns: remove AI_V4MAPPED hint flag on FreeBSD #9212

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/dns.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,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)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since the flag is simply invalid, why adding && family !== 6 ?

Another (more elaborate) question is whether mapped/not-mapped IPv4 addresses should just have been abstracted from the clients.

hints &= ~exports.V4MAPPED;
} else {
family = options >>> 0;
}
Expand Down