TCP: Check return value of ProtocolSocket::Open().

This commit is contained in:
Augustin Cavalier 2024-03-23 15:17:50 -04:00
parent 1e0c1ca344
commit c9eb52ae09

View File

@ -1473,15 +1473,17 @@ TCPEndpoint::_Spawn(TCPEndpoint* parent, tcp_segment_header& segment,
TRACE("Spawn()");
// TODO error checking
ProtocolSocket::Open();
// TODO: proper error handling!
if (ProtocolSocket::Open() != B_OK) {
T(Error(this, "opening failed", __LINE__));
return DROP;
}
fState = SYNCHRONIZE_RECEIVED;
T(Spawn(parent, this));
fManager = parent->fManager;
// TODO: proper error handling!
if (fManager->BindChild(this, buffer->destination) != B_OK) {
T(Error(this, "binding failed", __LINE__));
return DROP;