Skip to content

Commit

Permalink
[mle] request network data on child reattach after reboot (openthread…
Browse files Browse the repository at this point in the history
…#2466)

This commit adds a Network Data TLV request to the MLE Child Update Request
message when trying to resynchronize with a parent after reset.  This
eliminates the need for an MLE Data Request/Response exchange following the
MLE Child Update Request/Response exchange.
  • Loading branch information
jwhui authored Jan 12, 2018
1 parent 1b4c82c commit 87d8940
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/core/thread/mle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1807,14 +1807,18 @@ otError Mle::SendChildUpdateRequest(void)
switch (mRole)
{
case OT_DEVICE_ROLE_DETACHED:
{
static const uint8_t tlvs[] = {Tlv::kNetworkData};

for (uint8_t i = 0; i < sizeof(mParentRequest.mChallenge); i++)
{
mParentRequest.mChallenge[i] = static_cast<uint8_t>(otPlatRandomGet());
}

SuccessOrExit(error = AppendChallenge(*message, mParentRequest.mChallenge,
sizeof(mParentRequest.mChallenge)));
SuccessOrExit(error = AppendChallenge(*message, mParentRequest.mChallenge, sizeof(mParentRequest.mChallenge)));
SuccessOrExit(error = AppendTlvRequest(*message, tlvs, sizeof(tlvs)));
break;
}

case OT_DEVICE_ROLE_CHILD:
SuccessOrExit(error = AppendSourceAddress(*message));
Expand Down

0 comments on commit 87d8940

Please sign in to comment.