mirror of
https://github.com/espressif/openthread.git
synced 2026-09-11 19:50:05 +00:00
[mle] avoid scheduling RetxTracker timer when disabled (#11721)
This commit adds a check in `RetxTracker::ScheduleTimer()` to ensure the timer is not scheduled if MLE operations are disabled. This change improves safety by handling an edge case during the graceful detach process. In this scenario, a child sends a "Child Update Request" with a zero timeout and, upon receiving a response, immediately stops MLE. The added check prevents the retransmission timer from being incorrectly scheduled after MLE has been stopped.
This commit is contained in:
@@ -5556,6 +5556,9 @@ void Mle::RetxTracker::UpdateOnDataResponseRx(void)
|
||||
void Mle::RetxTracker::ScheduleTimer(void)
|
||||
{
|
||||
mTimer.Stop();
|
||||
|
||||
VerifyOrExit(!Get<Mle>().IsDisabled());
|
||||
|
||||
mChildUpdate.Schedule(mTimer);
|
||||
|
||||
// We defer sending Data Request while awaiting a Child Update
|
||||
@@ -5565,12 +5568,17 @@ void Mle::RetxTracker::ScheduleTimer(void)
|
||||
{
|
||||
mDataRequest.Schedule(mTimer);
|
||||
}
|
||||
|
||||
exit:
|
||||
return;
|
||||
}
|
||||
|
||||
void Mle::RetxTracker::HandleTimer(void)
|
||||
{
|
||||
TimeMilli now = TimerMilli::GetNow();
|
||||
|
||||
VerifyOrExit(!Get<Mle>().IsDisabled());
|
||||
|
||||
if (mChildUpdate.ShouldSend(now))
|
||||
{
|
||||
SuccessOrExit(mChildUpdate.DetachIfMaxAttemptsReached(Get<Mle>()));
|
||||
|
||||
Reference in New Issue
Block a user