diff --git a/src/core/meshcop/dataset_manager_ftd.cpp b/src/core/meshcop/dataset_manager_ftd.cpp index 077cd79e1bf..171919e23a1 100644 --- a/src/core/meshcop/dataset_manager_ftd.cpp +++ b/src/core/meshcop/dataset_manager_ftd.cpp @@ -212,6 +212,8 @@ Error DatasetManager::HandleSet(const Coap::Message &aMessage, const Ip6::Messag StateTlv::State state = StateTlv::kReject; SetRequestInfo info; + VerifyOrExit(Get().IsLeader()); + SuccessOrExit(ProcessSetRequest(aMessage, info)); if (IsActiveDataset() && info.mAffectsConnectivity) @@ -374,7 +376,6 @@ void ActiveDatasetManager::StartLeader(void) {} template <> void ActiveDatasetManager::HandleTmf(Coap::Message &aMessage, const Ip6::MessageInfo &aMessageInfo) { - VerifyOrExit(Get().IsLeader()); SuccessOrExit(DatasetManager::HandleSet(aMessage, aMessageInfo)); IgnoreError(ApplyConfiguration()); @@ -387,7 +388,6 @@ void PendingDatasetManager::StartLeader(void) { StartDelayTimer(); } template <> void PendingDatasetManager::HandleTmf(Coap::Message &aMessage, const Ip6::MessageInfo &aMessageInfo) { - VerifyOrExit(Get().IsLeader()); SuccessOrExit(DatasetManager::HandleSet(aMessage, aMessageInfo)); StartDelayTimer();