[netdata] ensure to free context ID once (#8860)

This commit updates `NetworkData::Leader::HandleTimer()` such that
once the reuse delay time for a previously used Context ID is reached
and the ID is freed, the `mContextLastUsed` is also set to zero. This
ensures that context ID is freed only once from `HandleTimer
()` calls (which avoids incrementing the version again).
This commit is contained in:
Abtin Keshavarzian
2023-03-13 16:52:13 -07:00
committed by GitHub
parent c81e8d3fd0
commit 7ecc5d104e
@@ -1336,6 +1336,7 @@ void Leader::HandleTimer(void)
if (TimerMilli::GetNow() - mContextLastUsed[i] >= Time::SecToMsec(mContextIdReuseDelay))
{
mContextLastUsed[i].SetValue(0);
FreeContextId(kMinContextId + i);
}
else