Kernel: Prevent RST spam when we get an unexpected packet

This commit is contained in:
Conrad Pankoff 2019-08-08 12:29:34 +10:00 committed by Andreas Kling
parent 98ce498922
commit 061c092fae
Notes: sideshowbarker 2024-07-19 12:49:46 +09:00

View file

@ -341,9 +341,7 @@ void handle_tcp(const EthernetFrameHeader& eth, int frame_size)
switch (socket->state()) {
case TCPSocket::State::Closed:
kprintf("handle_tcp: unexpected flags in Closed state\n");
socket->send_tcp_packet(TCPFlags::RST);
socket->set_state(TCPSocket::State::Closed);
kprintf("handle_tcp: Closed -> Closed\n");
// TODO: we may want to send an RST here, maybe as a configurable option
return;
case TCPSocket::State::TimeWait:
kprintf("handle_tcp: unexpected flags in TimeWait state\n");