summaryrefslogtreecommitdiff
path: root/Kernel/Net
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Net')
-rw-r--r--Kernel/Net/NetworkTask.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Kernel/Net/NetworkTask.cpp b/Kernel/Net/NetworkTask.cpp
index 92dd3aca6b..cf8f617e7e 100644
--- a/Kernel/Net/NetworkTask.cpp
+++ b/Kernel/Net/NetworkTask.cpp
@@ -528,6 +528,11 @@ void handle_tcp(const IPv4Packet& ipv4_packet, const Time& packet_timestamp)
return;
}
case TCPSocket::State::Established:
+ if (tcp_packet.has_rst()) {
+ socket->set_state(TCPSocket::State::Closed);
+ return;
+ }
+
if (tcp_packet.has_fin()) {
if (payload_size != 0)
socket->did_receive(ipv4_packet.source(), tcp_packet.source_port(), KBuffer::copy(&ipv4_packet, sizeof(IPv4Packet) + ipv4_packet.payload_size()), packet_timestamp);