mirror of
https://github.com/espressif/openthread.git
synced 2026-08-12 05:37:46 +00:00
[mle] kAppendMeshLocalOnly for Child Update Request when detached (#5295)
When the child reboot, only register the mesh local address to avoid possible large Child Update Response which would be fragmented, thus avoiding reattach process.
This commit is contained in:
+10
-8
@@ -2220,9 +2220,10 @@ exit:
|
||||
|
||||
otError Mle::SendChildUpdateRequest(void)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
Ip6::Address destination;
|
||||
Message * message = nullptr;
|
||||
otError error = OT_ERROR_NONE;
|
||||
Ip6::Address destination;
|
||||
Message * message = nullptr;
|
||||
AddressRegistrationMode mode = kAppendAllAddresses;
|
||||
|
||||
if (!mParent.IsStateValidOrRestoring())
|
||||
{
|
||||
@@ -2239,16 +2240,12 @@ otError Mle::SendChildUpdateRequest(void)
|
||||
SuccessOrExit(error = AppendHeader(*message, Header::kCommandChildUpdateRequest));
|
||||
SuccessOrExit(error = AppendMode(*message, mDeviceMode));
|
||||
|
||||
if (!IsFullThreadDevice())
|
||||
{
|
||||
SuccessOrExit(error = AppendAddressRegistration(*message));
|
||||
}
|
||||
|
||||
switch (mRole)
|
||||
{
|
||||
case kRoleDetached:
|
||||
mParentRequestChallenge.GenerateRandom();
|
||||
SuccessOrExit(error = AppendChallenge(*message, mParentRequestChallenge));
|
||||
mode = kAppendMeshLocalOnly;
|
||||
break;
|
||||
|
||||
case kRoleChild:
|
||||
@@ -2264,6 +2261,11 @@ otError Mle::SendChildUpdateRequest(void)
|
||||
OT_UNREACHABLE_CODE(break);
|
||||
}
|
||||
|
||||
if (!IsFullThreadDevice())
|
||||
{
|
||||
SuccessOrExit(error = AppendAddressRegistration(*message, mode));
|
||||
}
|
||||
|
||||
destination.SetToLinkLocalAddress(mParent.GetExtAddress());
|
||||
SuccessOrExit(error = SendMessage(*message, destination));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user