diff --git a/src/core/meshcop/meshcop_leader.cpp b/src/core/meshcop/meshcop_leader.cpp index 00a9e5eb877..08d99c6d6a6 100644 --- a/src/core/meshcop/meshcop_leader.cpp +++ b/src/core/meshcop/meshcop_leader.cpp @@ -73,6 +73,8 @@ template <> void Leader::HandleTmf(Coap::Message &aMessage, LogInfo("Received %s", UriToString()); + VerifyOrExit(Get().IsLeader()); + VerifyOrExit(Get().IsRoutingLocator(aMessageInfo.GetPeerAddr())); SuccessOrExit(Tlv::FindTlv(aMessage, commissionerId)); @@ -152,6 +154,8 @@ template <> void Leader::HandleTmf(Coap::Message &aMessage, LogInfo("Received %s", UriToString()); + VerifyOrExit(Get().IsLeader()); + SuccessOrExit(Tlv::Find(aMessage, state)); SuccessOrExit(Tlv::Find(aMessage, sessionId));