From af71aa4e0bcc7ba4b6a1a6b5cf4f365c7b994a0f Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Sun, 3 Jul 2022 23:23:45 +0300 Subject: [PATCH] Kernel: Negate condition in ARPTableBlockerSet::should_add_blocker To prevent a race condition in case we received the ARP response in the window between creating and initializing the Thread Blocker and the actual blocking, we were checking if the IP address was updated in the ARP table just before starting to block. Unfortunately, the condition was partially flipped, which meant that if the table was updated with the IP address we would still end up blocking, at which point we would never end unblocking again, which would result in LookupServer locking up as well. --- Kernel/Net/Routing.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/Net/Routing.cpp b/Kernel/Net/Routing.cpp index a96a201a5c..77c314acd2 100644 --- a/Kernel/Net/Routing.cpp +++ b/Kernel/Net/Routing.cpp @@ -76,7 +76,7 @@ protected: }); if (!maybe_mac_address.has_value()) return true; - return blocker.unblock_if_matching_ip_address(true, blocker.ip_address(), maybe_mac_address.value()); + return !blocker.unblock_if_matching_ip_address(true, blocker.ip_address(), maybe_mac_address.value()); } };