mirror of
https://github.com/espressif/openthread.git
synced 2026-10-03 22:37:36 +00:00
[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user