Skip to content

Commit

Permalink
[csl] ignore zero valued CSL IE period
Browse files Browse the repository at this point in the history
Ignore a CSL IE with period set to 0.

Accepting it would eventually lead to a division by 0 fault in
`CslTxScheduler::GetNextCslTransmissionDelay`.
  • Loading branch information
edmont committed Sep 11, 2023
1 parent 0b269e1 commit c2b2912
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/mac/mac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2329,6 +2329,8 @@ void Mac::ProcessCsl(const RxFrame &aFrame, const Address &aSrcAddr)
VerifyOrExit(child != nullptr);

csl = reinterpret_cast<const CslIe *>(cur + sizeof(HeaderIe));
VerifyOrExit(csl->GetPeriod() != 0);

child->SetCslPeriod(csl->GetPeriod());
child->SetCslPhase(csl->GetPhase());
child->SetCslSynchronized(true);
Expand Down

0 comments on commit c2b2912

Please sign in to comment.