[mesh-forwarder] use Mle::RouterIdMatch() helper method (#4486)

This commit is contained in:
Abtin Keshavarzian
2020-01-17 12:34:28 -08:00
committed by Jonathan Hui
parent e2403f6066
commit b7a56cdfd7
2 changed files with 2 additions and 3 deletions
+1 -2
View File
@@ -614,8 +614,7 @@ void MeshForwarder::UpdateRoutes(uint8_t * aFrame,
neighbor = Get<Mle::MleRouter>().GetNeighbor(ip6Header.GetSource());
VerifyOrExit(neighbor != NULL && !neighbor->IsFullThreadDevice());
if (Mle::Mle::RouterIdFromRloc16(aMeshSource.GetShort()) !=
Mle::Mle::RouterIdFromRloc16(Get<Mac::Mac>().GetShortAddress()))
if (!Mle::Mle::RouterIdMatch(aMeshSource.GetShort(), Get<Mac::Mac>().GetShortAddress()))
{
Get<Mle::MleRouter>().RemoveNeighbor(*neighbor);
}
+1 -1
View File
@@ -946,7 +946,7 @@ public:
*/
static bool RouterIdMatch(uint16_t aRloc16A, uint16_t aRloc16B)
{
return ((aRloc16A >> kRouterIdOffset) == (aRloc16B >> kRouterIdOffset));
return RouterIdFromRloc16(aRloc16A) == RouterIdFromRloc16(aRloc16B);
}
/**