From db07366e22c7d5f69732635b881dc5e555756c2a Mon Sep 17 00:00:00 2001 From: Dan Aprahamian Date: Fri, 15 Nov 2019 11:15:50 -0500 Subject: [PATCH] fix(connect): connect with family 0 instead of family 4 This is a fix for a hard-to-reproduce bug that occurs in certain network setups on Windows 10. In those cases, attempting an IPv6 lookup with a shortname will somehow cause the subsequent IPv4 lookup to also fail, even though it can succeed independently. For some reason, this does NOT happen with family: 0. This really should be fixed in either Node or in Windows itself, but since we cannot create a stable reproducer, we will use this fix short-term while we come up with a more stable solution. Fixes NODE-1747 Fixes NODE-2143 --- lib/core/connection/connect.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/connection/connect.js b/lib/core/connection/connect.js index 1d09ceb7c05..46c0b9edd93 100644 --- a/lib/core/connection/connect.js +++ b/lib/core/connection/connect.js @@ -35,7 +35,7 @@ function connect(options, callback) { return makeConnection(6, options, (err, ipv6Socket) => { if (err) { - makeConnection(4, options, (err, ipv4Socket) => { + makeConnection(0, options, (err, ipv4Socket) => { if (err) { callback(err, ipv4Socket); // in the error case, `ipv4Socket` is the originating error event name return;