mirror of
https://github.com/espressif/openthread.git
synced 2026-09-08 02:00:12 +00:00
MLE: Fix restore of rx-on children. (#1853)
This commit is contained in:
committed by
Jonathan Hui
parent
5f6a0a8514
commit
6fcab15f2d
@@ -2204,7 +2204,7 @@ void Mle::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageIn
|
|||||||
case Header::kCommandChildUpdateRequest:
|
case Header::kCommandChildUpdateRequest:
|
||||||
if (mRole == OT_DEVICE_ROLE_LEADER || mRole == OT_DEVICE_ROLE_ROUTER)
|
if (mRole == OT_DEVICE_ROLE_LEADER || mRole == OT_DEVICE_ROLE_ROUTER)
|
||||||
{
|
{
|
||||||
mNetif.GetMle().HandleChildUpdateRequest(aMessage, aMessageInfo);
|
mNetif.GetMle().HandleChildUpdateRequest(aMessage, aMessageInfo, keySequence);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2215,7 +2215,8 @@ exit:
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
otError MleRouter::HandleChildUpdateRequest(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo)
|
otError MleRouter::HandleChildUpdateRequest(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo,
|
||||||
|
uint32_t aKeySequence)
|
||||||
{
|
{
|
||||||
static const uint8_t kMaxResponseTlvs = 10;
|
static const uint8_t kMaxResponseTlvs = 10;
|
||||||
|
|
||||||
@@ -2315,6 +2316,12 @@ otError MleRouter::HandleChildUpdateRequest(const Message &aMessage, const Ip6::
|
|||||||
|
|
||||||
child->SetLastHeard(Timer::GetNow());
|
child->SetLastHeard(Timer::GetNow());
|
||||||
|
|
||||||
|
if (child->IsStateRestoring())
|
||||||
|
{
|
||||||
|
SetChildStateToValid(child);
|
||||||
|
child->SetKeySequence(aKeySequence);
|
||||||
|
}
|
||||||
|
|
||||||
SendChildUpdateResponse(child, aMessageInfo, tlvs, tlvslength, &challenge);
|
SendChildUpdateResponse(child, aMessageInfo, tlvs, tlvslength, &challenge);
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
|||||||
@@ -691,7 +691,8 @@ private:
|
|||||||
otError HandleParentRequest(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
|
otError HandleParentRequest(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
|
||||||
otError HandleChildIdRequest(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo,
|
otError HandleChildIdRequest(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo,
|
||||||
uint32_t aKeySequence);
|
uint32_t aKeySequence);
|
||||||
otError HandleChildUpdateRequest(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
|
otError HandleChildUpdateRequest(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo,
|
||||||
|
uint32_t aKeySequence);
|
||||||
otError HandleChildUpdateResponse(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo,
|
otError HandleChildUpdateResponse(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo,
|
||||||
uint32_t aKeySequence);
|
uint32_t aKeySequence);
|
||||||
otError HandleDataRequest(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
|
otError HandleDataRequest(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ private:
|
|||||||
otError HandleAdvertisement(const Message &, const Ip6::MessageInfo &) { return OT_ERROR_DROP; }
|
otError HandleAdvertisement(const Message &, const Ip6::MessageInfo &) { return OT_ERROR_DROP; }
|
||||||
otError HandleParentRequest(const Message &, const Ip6::MessageInfo &) { return OT_ERROR_DROP; }
|
otError HandleParentRequest(const Message &, const Ip6::MessageInfo &) { return OT_ERROR_DROP; }
|
||||||
otError HandleChildIdRequest(const Message &, const Ip6::MessageInfo &, uint32_t) { return OT_ERROR_DROP; }
|
otError HandleChildIdRequest(const Message &, const Ip6::MessageInfo &, uint32_t) { return OT_ERROR_DROP; }
|
||||||
otError HandleChildUpdateRequest(const Message &, const Ip6::MessageInfo &) { return OT_ERROR_DROP; }
|
otError HandleChildUpdateRequest(const Message &, const Ip6::MessageInfo &, uint32_t) { return OT_ERROR_DROP; }
|
||||||
otError HandleChildUpdateResponse(const Message &, const Ip6::MessageInfo &, uint32_t) { return OT_ERROR_DROP; }
|
otError HandleChildUpdateResponse(const Message &, const Ip6::MessageInfo &, uint32_t) { return OT_ERROR_DROP; }
|
||||||
otError HandleDataRequest(const Message &, const Ip6::MessageInfo &) { return OT_ERROR_DROP; }
|
otError HandleDataRequest(const Message &, const Ip6::MessageInfo &) { return OT_ERROR_DROP; }
|
||||||
otError HandleNetworkDataUpdateRouter(void) { return OT_ERROR_NONE; }
|
otError HandleNetworkDataUpdateRouter(void) { return OT_ERROR_NONE; }
|
||||||
|
|||||||
@@ -83,6 +83,14 @@ public:
|
|||||||
*/
|
*/
|
||||||
void SetState(State aState) { mState = static_cast<uint8_t>(aState); }
|
void SetState(State aState) { mState = static_cast<uint8_t>(aState); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the neighbor/child is being restored.
|
||||||
|
*
|
||||||
|
* @returns TRUE if the neighbor is being restored, FALSE otherwise.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
bool IsStateRestoring(void) const { return (mState == kStateRestored) || (mState == kStateChildUpdateRequest); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the neighbor/child is in valid state or if it is being restored.
|
* Check if the neighbor/child is in valid state or if it is being restored.
|
||||||
* When in these states messages can be sent to and/or received from the neighbor/child.
|
* When in these states messages can be sent to and/or received from the neighbor/child.
|
||||||
@@ -90,7 +98,7 @@ public:
|
|||||||
* @returns TRUE if the neighbor is in valid, restored, or being restored states, FALSE otherwise.
|
* @returns TRUE if the neighbor is in valid, restored, or being restored states, FALSE otherwise.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
bool IsStateValidOrRestoring(void) const { return (mState == kStateValid) || (mState == kStateRestored); }
|
bool IsStateValidOrRestoring(void) const { return (mState == kStateValid) || IsStateRestoring(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method gets the device mode flags.
|
* This method gets the device mode flags.
|
||||||
|
|||||||
Reference in New Issue
Block a user