diff --git a/src/core/thread/mle_router.cpp b/src/core/thread/mle_router.cpp index 40c6c95a0..c5eb7b756 100644 --- a/src/core/thread/mle_router.cpp +++ b/src/core/thread/mle_router.cpp @@ -3447,7 +3447,7 @@ uint8_t MleRouter::GetCost(uint16_t aRloc16) VerifyOrExit(router != NULL && mRouterTable.GetRouter(router->GetNextHop()) != NULL); - routeCost = GetRouteCost(aRloc16) + GetLinkCost(mRouterTable.GetRouter(routerId)->GetNextHop()); + routeCost = GetRouteCost(aRloc16) + GetLinkCost(router->GetNextHop()); if (cost > routeCost) {