Skip to content

Commit 2d0105c

Browse files
pipobscurecodebytere
authored andcommitted
net: remove unreachable check in internalConnect
Checked all call-sites to ensure that this code is truly unreachable. addressType is always checked before internalConnect is even called. PR-URL: #24158 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 672879f commit 2d0105c

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/net.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -830,12 +830,9 @@ function internalConnect(
830830
if (addressType === 4) {
831831
localAddress = localAddress || '0.0.0.0';
832832
err = self._handle.bind(localAddress, localPort);
833-
} else if (addressType === 6) {
833+
} else { // addressType === 6
834834
localAddress = localAddress || '::';
835835
err = self._handle.bind6(localAddress, localPort);
836-
} else {
837-
self.destroy(new ERR_INVALID_ADDRESS_FAMILY(addressType));
838-
return;
839836
}
840837
debug('binding to localAddress: %s and localPort: %d (addressType: %d)',
841838
localAddress, localPort, addressType);

0 commit comments

Comments
 (0)