Enable local Pending Dataset when device detaches from the network (#954)

* Enable local Pending Dataset when device detaches from the network

* Remove a dead code in Mle::Stop()
This commit is contained in:
Shu Chen
2016-11-10 04:40:40 +08:00
committed by Jonathan Hui
parent a319791b70
commit 848863910b
+6 -5
View File
@@ -236,11 +236,6 @@ ThreadError Mle::Stop(bool aClearNetworkDatasets)
SetStateDetached();
mNetif.RemoveUnicastAddress(mMeshLocal16);
if (mDeviceState == kDeviceStateLeader)
{
mNetif.RemoveUnicastAddress(mLeaderAloc);
}
if (aClearNetworkDatasets)
{
mNetif.GetActiveDataset().Clear(true);
@@ -326,6 +321,12 @@ ThreadError Mle::BecomeDetached(void)
VerifyOrExit(mDeviceState != kDeviceStateDisabled, error = kThreadError_InvalidState);
if (mReattachState == kReattachStop)
{
mNetif.GetPendingDataset().UpdateDelayTimer();
mNetif.GetPendingDataset().Set(mNetif.GetPendingDataset().GetLocal());
}
SetStateDetached();
SetRloc16(Mac::kShortAddrInvalid);
BecomeChild(kMleAttachAnyPartition);