[mac] remove unnecessary cast of mMode2KeyMaterial to KeyMaterial (#7020)

This commit is contained in:
Abtin Keshavarzian
2021-09-20 13:24:40 -07:00
committed by GitHub
parent 5c22f6c521
commit 541126f26d
+3 -2
View File
@@ -1001,7 +1001,8 @@ void Mac::ProcessTransmitSecurity(TxFrame &aFrame)
case Frame::kKeyIdMode2:
{
const uint8_t keySource[] = {0xff, 0xff, 0xff, 0xff};
aFrame.SetAesKey(static_cast<const KeyMaterial &>(mMode2KeyMaterial));
aFrame.SetAesKey(mMode2KeyMaterial);
mKeyIdMode2FrameCounter++;
aFrame.SetFrameCounter(mKeyIdMode2FrameCounter);
@@ -1700,7 +1701,7 @@ Error Mac::ProcessReceiveSecurity(RxFrame &aFrame, const Address &aSrcAddr, Neig
break;
case Frame::kKeyIdMode2:
macKey = static_cast<const KeyMaterial *>(&mMode2KeyMaterial);
macKey = &mMode2KeyMaterial;
extAddress = static_cast<const ExtAddress *>(&sMode2ExtAddress);
break;