From 1d5dae85789ab1a9fe5db96339981b8d589b9145 Mon Sep 17 00:00:00 2001 From: rongli Date: Thu, 2 Jun 2016 23:51:43 +0800 Subject: [PATCH] remove unreachable condition (#100) --- src/core/thread/mle_router.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/core/thread/mle_router.cpp b/src/core/thread/mle_router.cpp index 4c20555cb..1303cf583 100644 --- a/src/core/thread/mle_router.cpp +++ b/src/core/thread/mle_router.cpp @@ -1252,15 +1252,7 @@ void MleRouter::UpdateRoutes(const RouteTlv &aRoute, uint8_t aRouterId) } } - if (i != aRouterId && cost == 0 && mRouters[i].mNextHop == aRouterId) - { - // route nexthop is neighbor, but neighbor no longer has route - ResetAdvertiseInterval(); - mRouters[i].mNextHop = kMaxRouterId; - mRouters[i].mCost = 0; - mRouters[i].mLastHeard = Timer::GetNow(); - } - else if (mRouters[i].mNextHop == kMaxRouterId || mRouters[i].mNextHop == aRouterId) + if (mRouters[i].mNextHop == kMaxRouterId || mRouters[i].mNextHop == aRouterId) { // route has no nexthop or nexthop is neighbor newCost = cost + GetLinkCost(aRouterId);