Skip to content

Commit

Permalink
net: fix address iteration with autoSelectFamily
Browse files Browse the repository at this point in the history
When `autoSelectFamily` is set to `true`, `net.connect` is supposed to
try connecting to both IPv4 and IPv6, interleaving the address types.
Instead, it appears that the array that holds the addresses in the order
they should be attempted was never used after being populated.

PR-URL: #48258
Backport-PR-URL: #48275
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
  • Loading branch information
indutny authored and juanarbol committed May 31, 2023
1 parent 97ff063 commit d8f15d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,7 @@ function lookupAndConnectMultiple(self, async_id_symbol, lookup, host, options,

const context = {
socket: self,
addresses,
addresses: toAttempt,
current: 0,
port,
localPort,
Expand Down

0 comments on commit d8f15d5

Please sign in to comment.