mirror of
https://github.com/espressif/openthread.git
synced 2026-07-22 20:14:07 +00:00
[mesh-forwarder] use Mle::RouterIdMatch() helper method (#4486)
This commit is contained in:
committed by
Jonathan Hui
parent
e2403f6066
commit
b7a56cdfd7
@@ -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);
|
||||
}
|
||||
|
||||
@@ -946,7 +946,7 @@ public:
|
||||
*/
|
||||
static bool RouterIdMatch(uint16_t aRloc16A, uint16_t aRloc16B)
|
||||
{
|
||||
return ((aRloc16A >> kRouterIdOffset) == (aRloc16B >> kRouterIdOffset));
|
||||
return RouterIdFromRloc16(aRloc16A) == RouterIdFromRloc16(aRloc16B);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user