mirror of
https://github.com/espressif/openthread.git
synced 2026-09-24 18:07:36 +00:00
[mle-router] ensure route table is logged only when changed (#6722)
This commit is contained in:
@@ -1441,7 +1441,7 @@ void MleRouter::UpdateRoutes(const RouteTlv &aRoute, uint8_t aRouterId)
|
||||
|
||||
if (nextHop == nullptr || nextHop == neighbor)
|
||||
{
|
||||
// route has no next hop or next hop is neighbor (sender)
|
||||
// router has no next hop or next hop is neighbor (sender)
|
||||
|
||||
if (cost + mRouterTable.GetLinkCost(*neighbor) < kMaxRouteCost)
|
||||
{
|
||||
@@ -1450,9 +1450,17 @@ void MleRouter::UpdateRoutes(const RouteTlv &aRoute, uint8_t aRouterId)
|
||||
resetAdvInterval = true;
|
||||
}
|
||||
|
||||
router->SetNextHop(aRouterId);
|
||||
router->SetCost(cost);
|
||||
changed = true;
|
||||
if (router->GetNextHop() != aRouterId)
|
||||
{
|
||||
router->SetNextHop(aRouterId);
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (router->GetCost() != cost)
|
||||
{
|
||||
router->SetCost(cost);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
else if (nextHop == neighbor)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user