From e5e7cb822a7d1beec3af5781dac275e441782632 Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Thu, 3 Feb 2022 16:28:33 +0200 Subject: [PATCH] Kernel: Ignore allocation failures when trying to retransmit packets We ignore allocation failures above the first 16 guaranteed socket slots, as we will just retransmit their packets the next time around. --- Kernel/Net/NetworkTask.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Kernel/Net/NetworkTask.cpp b/Kernel/Net/NetworkTask.cpp index 2b1dbcf3ca..e1d973af20 100644 --- a/Kernel/Net/NetworkTask.cpp +++ b/Kernel/Net/NetworkTask.cpp @@ -651,7 +651,9 @@ void retransmit_tcp_packets() // in case retransmit_packets() realizes that it wants to close the socket. NonnullRefPtrVector sockets; TCPSocket::sockets_for_retransmit().for_each_shared([&](const auto& socket) { - sockets.append(socket); + // We ignore allocation failures above the first 16 guaranteed socket slots, as + // we will just retransmit their packets the next time around + (void)sockets.try_append(socket); }); for (auto& socket : sockets) {