Skip to content

Commit

Permalink
Kernel: Don't respond to TCP RST packets
Browse files Browse the repository at this point in the history
As seen with GitHub Pages and probably lots of other hosts this might
cause a loop if the peer decides to respond to our RST packet again.
  • Loading branch information
gunnarbeutner authored and awesomekling committed Aug 18, 2021
1 parent 0bf867b commit c17f9ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Kernel/Net/NetworkTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ void handle_tcp(IPv4Packet const& ipv4_packet, Time const& packet_timestamp)
dbgln_if(TCP_DEBUG, "handle_tcp: looking for socket; tuple={}", tuple.to_string());

auto socket = TCPSocket::from_tuple(tuple);
if (!socket) {
if (!socket && !tcp_packet.has_rst()) {
dbgln("handle_tcp: No TCP socket for tuple {}. Sending RST.", tuple.to_string());
send_tcp_rst(ipv4_packet, tcp_packet, adapter);
return;
Expand Down

0 comments on commit c17f9ad

Please sign in to comment.