From 0e432396d66b3827b1ebea1283c9c3d8005925fd Mon Sep 17 00:00:00 2001 From: rongli Date: Sat, 28 May 2016 02:11:52 +0800 Subject: [PATCH] fix AddressRegistration issues (#83) --- src/core/thread/mle_router.cpp | 5 +++++ src/core/thread/mle_tlvs.hpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/thread/mle_router.cpp b/src/core/thread/mle_router.cpp index 98506b140..4c20555cb 100644 --- a/src/core/thread/mle_router.cpp +++ b/src/core/thread/mle_router.cpp @@ -2768,6 +2768,11 @@ ThreadError MleRouter::AppendChildAddresses(Message &aMessage, Child &aChild) for (size_t i = 0; i < sizeof(aChild.mIp6Address) / sizeof(aChild.mIp6Address[0]); i++) { + if (aChild.mIp6Address[i].IsUnspecified()) + { + break; + } + if (mNetworkData.GetContext(aChild.mIp6Address[i], context) == kThreadError_None) { // compressed entry diff --git a/src/core/thread/mle_tlvs.hpp b/src/core/thread/mle_tlvs.hpp index b3f289dfc..176aea228 100644 --- a/src/core/thread/mle_tlvs.hpp +++ b/src/core/thread/mle_tlvs.hpp @@ -1362,7 +1362,7 @@ public: aIndex--; } - return entry; + return (cur < end) ? entry : NULL; } private: