1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 00:45:08 +00:00

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

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");