[mle] change SendDataResponse() to return void (#4941)

This commit is contained in:
Jonathan Hui
2020-05-11 12:44:54 -07:00
parent 8ca96f0fd6
commit a173ed3838
2 changed files with 14 additions and 14 deletions
+13 -10
View File
@@ -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)
+1 -4
View File
@@ -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);