mirror of
https://github.com/espressif/openthread.git
synced 2026-10-25 16:53:55 +00:00
[address-resolver] use ExtAddress helper methods (#4181)
This commit is contained in:
committed by
Jonathan Hui
parent
d81af29640
commit
48b64f8d30
@@ -84,7 +84,7 @@ otError AddressResolver::GetEntry(uint8_t aIndex, otEidCacheEntry &aEntry) const
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
VerifyOrExit(aIndex < kCacheEntries, error = OT_ERROR_INVALID_ARGS);
|
||||
memcpy(&aEntry.mTarget, &mCache[aIndex].mTarget, sizeof(aEntry.mTarget));
|
||||
aEntry.mTarget = mCache[aIndex].mTarget;
|
||||
aEntry.mRloc16 = mCache[aIndex].mRloc16;
|
||||
aEntry.mAge = mCache[aIndex].mAge;
|
||||
aEntry.mValid = mCache[aIndex].mState == Cache::kStateCached;
|
||||
@@ -512,7 +512,7 @@ otError AddressResolver::SendAddressError(const ThreadTargetTlv & aTarget,
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(&messageInfo.GetPeerAddr(), aDestination, sizeof(messageInfo.GetPeerAddr()));
|
||||
messageInfo.SetPeerAddr(*aDestination);
|
||||
}
|
||||
|
||||
messageInfo.SetSockAddr(Get<Mle::MleRouter>().GetMeshLocal16());
|
||||
@@ -579,8 +579,8 @@ void AddressResolver::HandleAddressError(Coap::Message &aMessage, const Ip6::Mes
|
||||
}
|
||||
}
|
||||
|
||||
memcpy(&macAddr, mlIidTlv.GetIid(), sizeof(macAddr));
|
||||
macAddr.m8[0] ^= 0x2;
|
||||
macAddr.Set(mlIidTlv.GetIid());
|
||||
macAddr.ToggleLocal();
|
||||
|
||||
for (ChildTable::Iterator iter(GetInstance(), ChildTable::kInStateValid); !iter.IsDone(); iter++)
|
||||
{
|
||||
|
||||
@@ -305,8 +305,11 @@ public:
|
||||
*/
|
||||
void SetIid(const Mac::ExtAddress &aExtAddress)
|
||||
{
|
||||
memcpy(mIid, aExtAddress.m8, sizeof(mIid));
|
||||
mIid[0] ^= 0x2;
|
||||
Mac::ExtAddress addr;
|
||||
|
||||
addr = aExtAddress;
|
||||
addr.ToggleLocal();
|
||||
addr.CopyTo(mIid);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user