1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 17:48:12 +00:00

Kernel: Don't mark incoming sockets as connected in NetworkTask

An incoming socket should only be considered connected after a
program has received it from accept(). Before that point, it's only
"half" open, and it might not ever actually be served to a program.

Socket::accept is where m_connected is correctly set.
This commit is contained in:
Conrad Pankoff 2019-09-08 17:22:41 +10:00 committed by Andreas Kling
parent 72f728b0d6
commit b45cfae7f4

View file

@ -455,10 +455,9 @@ void handle_tcp(const IPv4Packet& ipv4_packet)
case TCPFlags::ACK:
socket->set_ack_number(tcp_packet.sequence_number() + payload_size);
socket->set_state(TCPSocket::State::Established);
if (socket->direction() == TCPSocket::Direction::Outgoing) {
socket->set_setup_state(Socket::SetupState::Completed);
socket->set_setup_state(Socket::SetupState::Completed);
if (socket->direction() == TCPSocket::Direction::Outgoing)
socket->set_connected(true);
}
socket->release_to_originator();
return;
default: