diff --git a/tests/nexus/platform/nexus_core.cpp b/tests/nexus/platform/nexus_core.cpp index 7686df2ae..0023bd61d 100644 --- a/tests/nexus/platform/nexus_core.cpp +++ b/tests/nexus/platform/nexus_core.cpp @@ -35,6 +35,7 @@ #include "nexus_node.hpp" #include "nexus_radio_model.hpp" #include "thread/child_table.hpp" +#include "thread/mle.hpp" #include "thread/neighbor_table.hpp" namespace ot { @@ -442,12 +443,11 @@ void Core::HandleNeighborTableChanged(otNeighborTableEvent aEvent, const otNeigh if (event == NeighborTable::kChildRemoved) { Instance &instance = *static_cast(aInfo->mInstance); - Neighbor *neighbor = - instance.Get().FindNeighbor(*extAddr, Neighbor::kInStateAnyExceptInvalid); + Neighbor *neighbor = instance.Get().FindNeighbor(*extAddr, Neighbor::kInStateValid); - if (neighbor != nullptr && !instance.Get().Contains(*neighbor)) + if (neighbor != nullptr) { - Log("Suppressing CHILD_REMOVED event because node is in router table"); + Log("Suppressing CHILD_REMOVED event because neighbor link is established"); ExitNow(); } }