mirror of
https://github.com/espressif/openthread.git
synced 2026-08-06 10:47:46 +00:00
[core] remove children when attached after receiving MLE Announce Messages (#3093)
This commit is contained in:
@@ -1578,6 +1578,14 @@ protected:
|
||||
*/
|
||||
void InformPreviousChannel(void);
|
||||
|
||||
/**
|
||||
* This method indicates whether or not in announce attach process.
|
||||
*
|
||||
* @retval true if attaching/attached on the announced parameters, false otherwise.
|
||||
*
|
||||
*/
|
||||
bool IsAnnounceAttach(void) const { return mAlternatePanId != Mac::kPanIdBroadcast; }
|
||||
|
||||
#if (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_NOTE) && (OPENTHREAD_CONFIG_LOG_MLE == 1)
|
||||
/**
|
||||
* This method converts an `AttachMode` enumeration value into a human-readable string.
|
||||
|
||||
@@ -268,6 +268,21 @@ otError MleRouter::HandleChildStart(AttachMode aMode)
|
||||
break;
|
||||
|
||||
case kAttachAny:
|
||||
// if attach was started due to receiving MLE Annouce Messageas, all rx-on-when-idle devices would
|
||||
// start attach immediately when receiving such Announce message as in Thread 1.1 specification,
|
||||
// Section 4.8.1,
|
||||
// "If the received value is newer and the channel and/or PAN ID in the Announce message differ
|
||||
// from those currently in use, the receiving device attempts to attach using the channel and
|
||||
// PAN ID received from the Announce message."
|
||||
//
|
||||
// That is, Parent-child relationship is highly unlikely to be kept in the new partition, so here
|
||||
// removes all children, leaving whether to become router according to the new partition status.
|
||||
if (IsAnnounceAttach() && HasChildren())
|
||||
{
|
||||
RemoveChildren();
|
||||
}
|
||||
|
||||
// fall through
|
||||
case kAttachBetter:
|
||||
if (HasChildren() && mPreviousPartitionIdRouter != mLeaderData.GetPartitionId())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user