[mac] use kPanIdBroadcast instead of kShortAddrBroadcast for PAN ID (#13558)

This commit replaces usages of `kShortAddrBroadcast` with
`kPanIdBroadcast` in `src/core/mac/mac.cpp` where PAN IDs are handled:

- In `Mac::PrepareBeaconRequest()`, set destination PAN ID using
  `kPanIdBroadcast` instead of `kShortAddrBroadcast`.
- In `Mac::HandleReceivedFrame()`, check destination PAN ID against
  `kPanIdBroadcast` instead of `kShortAddrBroadcast`.
This commit is contained in:
Jonathan Hui
2026-08-25 23:45:29 -07:00
committed by GitHub
parent 37579e8086
commit 7e2923bd68
+2 -2
View File
@@ -719,7 +719,7 @@ TxFrame *Mac::PrepareBeaconRequest(TxFrames &aTxFrames)
buildInfo.mAddrs.mSource.SetNone();
buildInfo.mAddrs.mDestination.SetShort(kShortAddrBroadcast);
buildInfo.mPanIds.SetDestination(kShortAddrBroadcast);
buildInfo.mPanIds.SetDestination(kPanIdBroadcast);
buildInfo.mType = Frame::kTypeMacCmd;
buildInfo.mCommandId = Frame::kMacCmdBeaconRequest;
@@ -1906,7 +1906,7 @@ void Mac::HandleReceivedFrame(RxFrame *aFrame, Error aError)
// Verify destination PAN ID if present
if (kErrorNone == aFrame->GetDstPanId(panId))
{
VerifyOrExit(panId == kShortAddrBroadcast || panId == mPanId, error = kErrorDestinationAddressFiltered);
VerifyOrExit(panId == kPanIdBroadcast || panId == mPanId, error = kErrorDestinationAddressFiltered);
}
// Source Address Filtering