mirror of
https://github.com/espressif/openthread.git
synced 2026-08-23 10:49:51 +00:00
Make REED should know if its parent is connected to leader (#526)
* Make REED should know if its parent is connected to leader
This commit is contained in:
@@ -1321,6 +1321,34 @@ ThreadError MleRouter::HandleAdvertisement(const Message &aMessage, const Ip6::M
|
||||
SetStateDetached();
|
||||
ExitNow(error = kThreadError_NoRoute);
|
||||
}
|
||||
|
||||
if ((mDeviceMode & ModeTlv::kModeFFD))
|
||||
{
|
||||
for (uint8_t i = 0, routeCount = 0; i < kMaxRouterId; i++)
|
||||
{
|
||||
if (route.IsRouterIdSet(i) == false)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (i != GetLeaderId())
|
||||
{
|
||||
routeCount++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (route.GetRouteCost(routeCount) > 0)
|
||||
{
|
||||
mRouters[GetLeaderId()].mNextHop = routerId;
|
||||
}
|
||||
else
|
||||
{
|
||||
mRouters[GetLeaderId()].mNextHop = kMaxRouterId;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user