fix SED issue (#109)

This commit is contained in:
rongli
2016-06-06 15:33:25 -07:00
committed by Jonathan Hui
parent 2bf8083670
commit cd6f0d239f
4 changed files with 34 additions and 8 deletions
+6
View File
@@ -99,6 +99,12 @@ bool Address::IsRealmLocalAllRoutersMulticast(void) const
m32[2] == 0 && m32[3] == HostSwap32(0x02));
}
bool Address::IsRoutingLocator(void) const
{
return (m16[4] == HostSwap16(0x0000) && m16[5] == HostSwap16(0x00ff) &&
m16[6] == HostSwap16(0xfe00));
}
const uint8_t *Address::GetIid(void) const
{
return m8 + kInterfaceIdentifierOffset;
+9
View File
@@ -178,6 +178,15 @@ public:
*/
bool IsRealmLocalAllRoutersMulticast(void) const;
/**
* This method indicates whether or not the IPv6 address is a RLOC address.
*
* @retval TRUE If the IPv6 address is a RLOC address.
* @retval FALSE If the IPv6 address is not a RLOC address.
*
*/
bool IsRoutingLocator(void) const;
/**
* This method returns a pointer to the Interface Identifier.
*
+10 -2
View File
@@ -281,7 +281,10 @@ ThreadError Netif::AddUnicastAddress(NetifUnicastAddress &aAddress)
aAddress.mNext = mUnicastAddresses;
mUnicastAddresses = &aAddress;
mUnicastChangedTask.Post();
if (!aAddress.GetAddress().IsRoutingLocator())
{
mUnicastChangedTask.Post();
}
exit:
return error;
@@ -311,7 +314,12 @@ ThreadError Netif::RemoveUnicastAddress(const NetifUnicastAddress &aAddress)
ExitNow(error = kThreadError_Error);
exit:
mUnicastChangedTask.Post();
if (!aAddress.GetAddress().IsRoutingLocator())
{
mUnicastChangedTask.Post();
}
return error;
}
+9 -6
View File
@@ -1059,6 +1059,7 @@ ThreadError Mle::SendChildUpdateRequest(void)
if ((mDeviceMode & ModeTlv::kModeRxOnWhenIdle) == 0)
{
mMesh.SetPollPeriod(kAttachDataPollPeriod);
mMesh.SetRxOnWhenIdle(false);
}
exit:
@@ -1736,7 +1737,8 @@ ThreadError Mle::HandleChildUpdateResponse(const Message &aMessage, const Ip6::M
error = kThreadError_Drop);
SetStateChild(GetRloc16());
break;
// fall through
case kDeviceStateChild:
// Leader Data
@@ -1758,11 +1760,12 @@ ThreadError Mle::HandleChildUpdateResponse(const Message &aMessage, const Ip6::M
ExitNow();
}
// Timeout
SuccessOrExit(error = Tlv::GetTlv(aMessage, Tlv::kTimeout, sizeof(timeout), timeout));
VerifyOrExit(timeout.IsValid(), error = kThreadError_Parse);
mTimeout = timeout.GetTimeout();
// Timeout optional
if (Tlv::GetTlv(aMessage, Tlv::kTimeout, sizeof(timeout), timeout) == kThreadError_None)
{
VerifyOrExit(timeout.IsValid(), error = kThreadError_Parse);
mTimeout = timeout.GetTimeout();
}
if ((mode.GetMode() & ModeTlv::kModeRxOnWhenIdle) == 0)
{