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.
This commit is contained in:
Idan Horowitz 2022-02-03 16:28:33 +02:00 committed by Andreas Kling
parent 2dc91865a4
commit e5e7cb822a
Notes: sideshowbarker 2024-07-17 19:49:52 +09:00

View file

@ -651,7 +651,9 @@ void retransmit_tcp_packets()
// in case retransmit_packets() realizes that it wants to close the socket.
NonnullRefPtrVector<TCPSocket, 16> 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) {