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.
This commit is contained in:
Gunnar Beutner 2021-05-28 00:00:58 +02:00 committed by Andreas Kling
parent 3fc75088a2
commit 377b06c8ac
Notes: sideshowbarker 2024-07-18 17:16:59 +09:00

View File

@ -503,6 +503,9 @@ void handle_tcp(const IPv4Packet& ipv4_packet, const Time& packet_timestamp)
return; return;
} }
return;
case TCPFlags::SYN:
dbgln("handle_tcp: ignoring SYN for partially established connection");
return; return;
default: default:
dbgln("handle_tcp: unexpected flags in SynReceived state ({:x})", tcp_packet.flags()); dbgln("handle_tcp: unexpected flags in SynReceived state ({:x})", tcp_packet.flags());