瀏覽代碼

Kernel: Prevent RST spam when we get an unexpected packet

Conrad Pankoff 6 年之前
父節點
當前提交
061c092fae
共有 1 個文件被更改,包括 1 次插入3 次删除
  1. 1 3
      Kernel/Net/NetworkTask.cpp

+ 1 - 3
Kernel/Net/NetworkTask.cpp

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