Skip to content

Commit c53117e

Browse files
pipobscureBridgeAR
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 <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent c07cce3 commit c53117e

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

‎lib/net.js‎

Lines changed: 1 addition & 4 deletions
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-
}elseif(addressType===6){
833+
}else{// addressType === 6
834834
localAddress=localAddress||'::';
835835
err=self._handle.bind6(localAddress,localPort);
836-
}else{
837-
self.destroy(newERR_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)