diff --git a/src/core/thread/mle_router.cpp b/src/core/thread/mle_router.cpp index 21fdf6856..c5cb365e0 100644 --- a/src/core/thread/mle_router.cpp +++ b/src/core/thread/mle_router.cpp @@ -2676,7 +2676,7 @@ void MleRouter::HandleDataRequest(const Message & aMessage, tlvs[numTlvs++] = Tlv::kPendingDataset; } - IgnoreError(SendDataResponse(aMessageInfo.GetPeerAddr(), tlvs, numTlvs, 0)); + SendDataResponse(aMessageInfo.GetPeerAddr(), tlvs, numTlvs, 0); exit: @@ -2697,7 +2697,7 @@ void MleRouter::HandleNetworkDataUpdateRouter(void) destination.SetToLinkLocalAllNodesMulticast(); delay = IsLeader() ? 0 : Random::NonCrypto::GetUint16InRange(0, kUnsolicitedDataResponseJitter); - IgnoreError(SendDataResponse(destination, tlvs, sizeof(tlvs), delay)); + SendDataResponse(destination, tlvs, sizeof(tlvs), delay); SynchronizeChildNetworkData(); @@ -3185,10 +3185,10 @@ exit: } } -otError MleRouter::SendDataResponse(const Ip6::Address &aDestination, - const uint8_t * aTlvs, - uint8_t aTlvsLength, - uint16_t aDelay) +void MleRouter::SendDataResponse(const Ip6::Address &aDestination, + const uint8_t * aTlvs, + uint8_t aTlvsLength, + uint16_t aDelay) { otError error = OT_ERROR_NONE; Message * message = NULL; @@ -3248,12 +3248,15 @@ otError MleRouter::SendDataResponse(const Ip6::Address &aDestination, exit: - if (error != OT_ERROR_NONE && message != NULL) + if (error != OT_ERROR_NONE) { - message->Free(); - } + otLogWarnMle("Failed to send Data Response: %s", otThreadErrorToString(error)); - return error; + if (message != NULL) + { + message->Free(); + } + } } bool MleRouter::IsMinimalChild(uint16_t aRloc16) diff --git a/src/core/thread/mle_router.hpp b/src/core/thread/mle_router.hpp index 661c8e261..fa487db1b 100644 --- a/src/core/thread/mle_router.hpp +++ b/src/core/thread/mle_router.hpp @@ -775,10 +775,7 @@ private: const uint8_t * aTlvs, uint8_t aTlvsLength, const Challenge & aChallenge); - otError SendDataResponse(const Ip6::Address &aDestination, - const uint8_t * aTlvs, - uint8_t aTlvsLength, - uint16_t aDelay); + void SendDataResponse(const Ip6::Address &aDestination, const uint8_t *aTlvs, uint8_t aTlvsLength, uint16_t aDelay); otError SendDiscoveryResponse(const Ip6::Address &aDestination, uint16_t aPanId); void SetStateRouter(uint16_t aRloc16);