diff --git a/src/core/thread/mle_router.cpp b/src/core/thread/mle_router.cpp index 694baea06..ed95dcb3e 100644 --- a/src/core/thread/mle_router.cpp +++ b/src/core/thread/mle_router.cpp @@ -1970,11 +1970,13 @@ ThreadError MleRouter::UpdateChildAddresses(const AddressRegistrationTlv &aTlv, Ip6::Address address; Lowpan::Context context; Child *child; + uint8_t count; uint8_t index; + char stringBuffer[Ip6::Address::kIp6AddressStringSize]; aChild.ClearIp6Addresses(); - for (uint8_t count = 0; count < Child::kMaxIp6AddressPerChild; count++) + for (count = 0; count < Child::kMaxIp6AddressPerChild; count++) { if ((entry = aTlv.GetAddressEntry(count)) == NULL) { @@ -1995,6 +1997,9 @@ ThreadError MleRouter::UpdateChildAddresses(const AddressRegistrationTlv &aTlv, aChild.GetIp6Address(count) = address; + otLogInfoMle(GetInstance(), "Child 0x%04x IPv6 address[%d]=%s", aChild.GetRloc16(), count, + address.ToString(stringBuffer, sizeof(stringBuffer))); + // We check if the same address is in-use by another child, if so // remove it. This implements "last-in wins" duplicate address // resolution policy. @@ -2021,6 +2026,18 @@ ThreadError MleRouter::UpdateChildAddresses(const AddressRegistrationTlv &aTlv, } } + if (count == 0) + { + otLogInfoMle(GetInstance(), "Child 0x%04x has no registered IPv6 address", aChild.GetRloc16()); + } + else + { + otLogInfoMle(GetInstance(), "Child 0x%04x has %d registered IPv6 address%s", aChild.GetRloc16(), count, + (count == 1) ? "" : "es"); + } + + (void)stringBuffer; + return kThreadError_None; }