From 515e3bde8c1a899e0dda7718e14e15256fd7e4c1 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Thu, 16 Jan 2020 19:06:34 -0800 Subject: [PATCH] [mle] update route table log message (#4486) This commit updates the route table log message to include if link is established with router or not (router is a neighbor). Also the `0xffff` is printed as next hop if it is invalid and we indicate if the entry is for the device itself. --- src/core/thread/mle_router.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core/thread/mle_router.cpp b/src/core/thread/mle_router.cpp index c5eb7b756..7e6f00bcb 100644 --- a/src/core/thread/mle_router.cpp +++ b/src/core/thread/mle_router.cpp @@ -1528,9 +1528,11 @@ void MleRouter::UpdateRoutes(const RouteTlv &aRoute, uint8_t aRouterId) { Router &router = *iter.GetRouter(); - otLogInfoMle(" %04x -> %04x, cost:%d %d, lqin:%d, lqout:%d", router.GetRloc16(), - GetRloc16(router.GetNextHop()), router.GetCost(), mRouterTable.GetLinkCost(router), - router.GetLinkInfo().GetLinkQuality(), router.GetLinkQualityOut()); + otLogInfoMle(" %04x -> %04x, cost:%d %d, lqin:%d, lqout:%d, link:%s", router.GetRloc16(), + (router.GetNextHop() == kInvalidRouterId) ? 0xffff : GetRloc16(router.GetNextHop()), + router.GetCost(), mRouterTable.GetLinkCost(router), router.GetLinkInfo().GetLinkQuality(), + router.GetLinkQualityOut(), + router.GetRloc16() == GetRloc16() ? "device" : (router.IsStateValid() ? "yes" : "no")); } #else