[netif] add diagnostic log for when no valid route is found (#8907)

The added log may assist in diagnosing problems where packet
transmission over the air is absent.

Signed-off-by: Lukasz Duda <[email protected]>
This commit is contained in:
Łukasz Duda
2023-03-28 20:32:27 -07:00
committed by GitHub
parent c03ca44662
commit edd92c6cdf
+10 -4
View File
@@ -1448,14 +1448,20 @@ Error Ip6::RouteLookup(const Address &aSource, const Address &aDestination) cons
Error error;
uint16_t rloc;
SuccessOrExit(error = Get<NetworkData::Leader>().RouteLookup(aSource, aDestination, rloc));
error = Get<NetworkData::Leader>().RouteLookup(aSource, aDestination, rloc);
if (rloc == Get<Mle::Mle>().GetRloc16())
if (error == kErrorNone)
{
error = kErrorNoRoute;
if (rloc == Get<Mle::MleRouter>().GetRloc16())
{
error = kErrorNoRoute;
}
}
else
{
LogNote("Failed to find valid route for: %s", aDestination.ToString().AsCString());
}
exit:
return error;
}