summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrapru <brapru@pm.me>2021-07-18 10:39:20 -0400
committerGunnar Beutner <gunnar@beutner.name>2021-08-02 02:45:56 +0200
commit63a15ed19db424c710064bf1e46f3f695ac43e77 (patch)
treefbf2a0c46e0182a922f801bfbd9a70f6fdd25314
parentb5d9b4e7eeb11969524a87e8bcb9ec1070309f28 (diff)
downloadserenity-63a15ed19db424c710064bf1e46f3f695ac43e77.zip
Kernel: Do not send delayed ack in response to RST/ACK
In accordance with RFC 793, if the receiver is in the SYN-SENT state it should respond to a RST by aborting the connection and immediately move to the CLOSED state. Previously the system would ACK all RST/ACKs, and the remote peer would just respond with more RST packets.
-rw-r--r--Kernel/Net/NetworkTask.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/Kernel/Net/NetworkTask.cpp b/Kernel/Net/NetworkTask.cpp
index 5c3de379f6..745daad68e 100644
--- a/Kernel/Net/NetworkTask.cpp
+++ b/Kernel/Net/NetworkTask.cpp
@@ -460,8 +460,6 @@ void handle_tcp(IPv4Packet const& ipv4_packet, Time const& packet_timestamp)
socket->set_setup_state(Socket::SetupState::Completed);
return;
case TCPFlags::ACK | TCPFlags::RST:
- socket->set_ack_number(tcp_packet.sequence_number() + payload_size);
- send_delayed_tcp_ack(socket);
socket->set_state(TCPSocket::State::Closed);
socket->set_error(TCPSocket::Error::RSTDuringConnect);
socket->set_setup_state(Socket::SetupState::Completed);