From 377b06c8ac479cfaa3df13fd182db5957908c6f3 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Fri, 28 May 2021 00:00:58 +0200 Subject: [PATCH] Kernel: Ignore duplicate SYN packets When receiving a SYN packet for a connection that's in the "SYN received" state we should ignore the duplicate SYN packet instead of closing the connection. This can happen when we didn't accept the connection in time and our peer has sent us another SYN packet because it thought that the initial SYN packet was lost. --- Kernel/Net/NetworkTask.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Kernel/Net/NetworkTask.cpp b/Kernel/Net/NetworkTask.cpp index 8db8da6c08..f7f54061cf 100644 --- a/Kernel/Net/NetworkTask.cpp +++ b/Kernel/Net/NetworkTask.cpp @@ -503,6 +503,9 @@ void handle_tcp(const IPv4Packet& ipv4_packet, const Time& packet_timestamp) return; } + return; + case TCPFlags::SYN: + dbgln("handle_tcp: ignoring SYN for partially established connection"); return; default: dbgln("handle_tcp: unexpected flags in SynReceived state ({:x})", tcp_packet.flags());