diff --git a/lib/net.js b/lib/net.js index 66fc3578ca57fa..fcc24b22fb642c 100644 --- a/lib/net.js +++ b/lib/net.js @@ -1094,6 +1094,16 @@ Socket.prototype.connect = function(...args) { return this; }; +function socketToDnsFamily(family) { + switch (family) { + case 'IPv4': + return 4; + case 'IPv6': + return 6; + } + + return family; +} function lookupAndConnect(self, options) { const { localAddress, localPort } = options; @@ -1136,7 +1146,7 @@ function lookupAndConnect(self, options) { if (dns === undefined) dns = require('dns'); const dnsopts = { - family: options.family, + family: socketToDnsFamily(options.family), hints: options.hints || 0 }; diff --git a/test/parallel/parallel.status b/test/parallel/parallel.status index 911787a091b5e3..bafd4e16aaf004 100644 --- a/test/parallel/parallel.status +++ b/test/parallel/parallel.status @@ -37,10 +37,6 @@ test-crypto-dh-stateless: SKIP test-crypto-keygen: SKIP [$system==solaris] # Also applies to SmartOS -# https://github.com/nodejs/node/pull/43054 -test-net-socket-connect-without-cb: SKIP -test-net-socket-ready-without-cb: SKIP -test-tcp-wrap-listen: SKIP # https://github.com/nodejs/node/issues/43446 test-net-connect-reset-until-connected: PASS, FLAKY # https://github.com/nodejs/node/issues/43457 @@ -65,12 +61,6 @@ test-worker-message-port-message-before-close: PASS,FLAKY # https://github.com/nodejs/node/issues/43446 test-net-connect-reset-until-connected: PASS, FLAKY -[$system==aix] -# https://github.com/nodejs/node/pull/43054 -test-net-socket-connect-without-cb: SKIP -test-net-socket-ready-without-cb: SKIP -test-tcp-wrap-listen: SKIP - [$system==ibmi] # https://github.com/nodejs/node/pull/30819 test-child-process-fork-net-server: SKIP