net: set ADDRCONFIG DNS hint in connections

b85a50b6da removed the implicit
setting of DNS hints when creating a connection. This caused some
of the pi2 machines to become flaky. This commit restores the
implicit dns.ADDRCONFIG hint, but not dns.V4MAPPED.

Fixes: https://github.com/nodejs/node/issues/6133
PR-URL: https://github.com/nodejs/node/pull/6281
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This commit is contained in:
cjihrig 2016-04-19 09:09:57 -04:00
Родитель 29ca969651
Коммит 54dd7c38e5
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -949,6 +949,10 @@ function lookupAndConnect(self, options) {
hints: options.hints || 0
};
if (dnsopts.family !== 4 && dnsopts.family !== 6 && dnsopts.hints === 0) {
dnsopts.hints = dns.ADDRCONFIG;
}
debug('connect: find host ' + host);
debug('connect: dns options', dnsopts);
self._host = host;