mirror of
https://github.com/espressif/openthread.git
synced 2026-08-11 05:07:47 +00:00
Mle_Router: Check the child's state to be valid when receiving a "Child Update Request" (#1270)
- In `HandleChildUpdateRequest()` check that the child is already in state `kStateValid` before sending the full reply. This addresses an issue during re-attach process (where the child could switch to valid state before counters were synced on the parent).
This commit is contained in:
committed by
Jonathan Hui
parent
db952fb1f6
commit
7b3ea11ebb
@@ -2252,7 +2252,7 @@ ThreadError MleRouter::HandleChildUpdateRequest(const Message &aMessage, const I
|
||||
|
||||
child = FindChild(macAddr);
|
||||
|
||||
if (child == NULL)
|
||||
if ((child == NULL) || (child->mState != Neighbor::kStateValid))
|
||||
{
|
||||
tlvs[tlvslength++] = Tlv::kStatus;
|
||||
SendChildUpdateResponse(NULL, aMessageInfo, tlvs, tlvslength, NULL);
|
||||
@@ -2326,7 +2326,6 @@ ThreadError MleRouter::HandleChildUpdateRequest(const Message &aMessage, const I
|
||||
|
||||
child->mLastHeard = Timer::GetNow();
|
||||
child->mAddSrcMatchEntryShort = true;
|
||||
child->mState = Neighbor::kStateValid;
|
||||
|
||||
SendChildUpdateResponse(child, aMessageInfo, tlvs, tlvslength, &challenge);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user