mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
Kernel: Tear down connections when we receive an RST packet
This commit is contained in:
parent
c03cbf83ab
commit
e0ac611a08
Notes:
sideshowbarker
2024-07-18 18:51:10 +09:00
Author: https://github.com/gunnarbeutner Commit: https://github.com/SerenityOS/serenity/commit/e0ac611a08a Pull-request: https://github.com/SerenityOS/serenity/pull/6762
1 changed files with 5 additions and 0 deletions
|
@ -528,6 +528,11 @@ void handle_tcp(const IPv4Packet& ipv4_packet, const Time& packet_timestamp)
|
|||
return;
|
||||
}
|
||||
case TCPSocket::State::Established:
|
||||
if (tcp_packet.has_rst()) {
|
||||
socket->set_state(TCPSocket::State::Closed);
|
||||
return;
|
||||
}
|
||||
|
||||
if (tcp_packet.has_fin()) {
|
||||
if (payload_size != 0)
|
||||
socket->did_receive(ipv4_packet.source(), tcp_packet.source_port(), KBuffer::copy(&ipv4_packet, sizeof(IPv4Packet) + ipv4_packet.payload_size()), packet_timestamp);
|
||||
|
|
Loading…
Reference in a new issue