Skip to content

Commit

Permalink
net: remove unreachable check in internalConnect
Browse files Browse the repository at this point in the history
Checked all call-sites to ensure that this code is truly unreachable.
addressType is always checked before internalConnect is even called.
  • Loading branch information
pipobscure committed Nov 7, 2018
1 parent 8c3f903 commit 1458c26
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -842,9 +842,6 @@ function internalConnect(
} else if (addressType === 6) {
localAddress = localAddress || '::';
err = self._handle.bind6(localAddress, localPort);
} else {
self.destroy(new ERR_INVALID_ADDRESS_FAMILY(addressType));
return;
}
debug('binding to localAddress: %s and localPort: %d (addressType: %d)',
localAddress, localPort, addressType);
Expand Down

0 comments on commit 1458c26

Please sign in to comment.