From dcc527cf2370aad56a4d8a2a21217f65f4fc18e2 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Thu, 20 Oct 2016 17:56:37 -0700 Subject: [PATCH] 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. --- src/core/thread/mle.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/thread/mle.cpp b/src/core/thread/mle.cpp index 40d7491a3..16dc9fbdc 100644 --- a/src/core/thread/mle.cpp +++ b/src/core/thread/mle.cpp @@ -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);