Kernel: Avoid deadlock when trying to send packets from the NetworkTask

fixes #6758
This commit is contained in:
Gunnar Beutner 2021-04-30 19:18:23 +02:00 committed by Andreas Kling
commit d8f92bdf96
Notes: sideshowbarker 2024-07-18 18:51:26 +09:00
4 changed files with 21 additions and 2 deletions

View file

@ -197,7 +197,8 @@ KResult TCPSocket::send_tcp_packet(u16 flags, const UserOrKernelBuffer* payload,
}
auto routing_decision = route_to(peer_address(), local_address(), bound_interface());
VERIFY(!routing_decision.is_zero());
if (routing_decision.is_zero())
return EHOSTUNREACH;
auto packet_buffer = UserOrKernelBuffer::for_kernel_buffer(buffer.data());
auto result = routing_decision.adapter->send_ipv4(
@ -214,7 +215,8 @@ KResult TCPSocket::send_tcp_packet(u16 flags, const UserOrKernelBuffer* payload,
void TCPSocket::send_outgoing_packets()
{
auto routing_decision = route_to(peer_address(), local_address(), bound_interface());
VERIFY(!routing_decision.is_zero());
if (routing_decision.is_zero())
return;
auto now = kgettimeofday();