summaryrefslogtreecommitdiff
path: root/Kernel/Net/NetworkTask.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Net/NetworkTask.cpp')
-rw-r--r--Kernel/Net/NetworkTask.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/Kernel/Net/NetworkTask.cpp b/Kernel/Net/NetworkTask.cpp
index 7484f297e3..70457c02c4 100644
--- a/Kernel/Net/NetworkTask.cpp
+++ b/Kernel/Net/NetworkTask.cpp
@@ -533,9 +533,16 @@ void handle_tcp(const IPv4Packet& ipv4_packet, const Time& packet_timestamp)
if (tcp_packet.sequence_number() != socket->ack_number()) {
dbgln_if(TCP_DEBUG, "Discarding out of order packet: seq {} vs. ack {}", tcp_packet.sequence_number(), socket->ack_number());
+ if (socket->duplicate_acks() < TCPSocket::maximum_duplicate_acks) {
+ dbgln_if(TCP_DEBUG, "Sending ACK with same ack number to trigger fast retransmission");
+ socket->set_duplicate_acks(socket->duplicate_acks() + 1);
+ unused_rc = socket->send_tcp_packet(TCPFlags::ACK);
+ }
return;
}
+ socket->set_duplicate_acks(0);
+
if (tcp_packet.has_fin()) {
if (payload_size != 0)
socket->did_receive(ipv4_packet.source(), tcp_packet.source_port(), { &ipv4_packet, sizeof(IPv4Packet) + ipv4_packet.payload_size() }, packet_timestamp);