Skip to content

Commit

Permalink
fix(connect): connect with family 0 instead of family 4
Browse files Browse the repository at this point in the history
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
  • Loading branch information
daprahamian authored and mbroadst committed Nov 25, 2019
1 parent 5ed4c07 commit 7a41279
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/core/connection/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7a41279

Please sign in to comment.