diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp index d1faf4c3e2..ef136c70b3 100644 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp @@ -353,6 +353,14 @@ template CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_AttachToThreadNetwork( const Thread::OperationalDataset & dataset, NetworkCommissioning::Internal::WirelessDriver::ConnectCallback * callback) { + Thread::OperationalDataset current_dataset; + // Validation the dataset change with the current state + ThreadStackMgrImpl().GetThreadProvision(current_dataset); + if (dataset.AsByteSpan().data_equal(current_dataset.AsByteSpan()) && callback == nullptr) + { + return CHIP_NO_ERROR; + } + // Reset the previously set callback since it will never be called in case incorrect dataset was supplied. mpConnectCallback = nullptr; ReturnErrorOnFailure(Impl()->SetThreadEnabled(false));