mle.cpp: Ensure to init the mLeaderAloc and set it with correct prefix len (#857)

This commit fixes an issue with the unicast address `mLeaderAloc`
to ensure that it is initialized properly and its prefix length is
correctly configured.
This commit is contained in:
Abtin Keshavarzian
2016-10-20 17:56:37 -07:00
committed by Jonathan Hui
parent cc5f48d66a
commit dcc527cf23
+6
View File
@@ -109,6 +109,12 @@ Mle::Mle(ThreadNetif &aThreadNetif) :
mLinkLocal16.mPreferredLifetime = 0xffffffff;
mLinkLocal16.mValidLifetime = 0xffffffff;
// Leader Aloc
memset(&mLeaderAloc, 0, sizeof(mLeaderAloc));
mLeaderAloc.mPrefixLength = 128;
mLeaderAloc.mPreferredLifetime = 0xffffffff;
mLeaderAloc.mValidLifetime = 0xffffffff;
// initialize Mesh Local Prefix
mMeshLocal64.GetAddress().mFields.m8[0] = 0xfd;
memcpy(mMeshLocal64.GetAddress().mFields.m8 + 1, mMac.GetExtendedPanId(), 5);