mirror of
https://github.com/espressif/openthread.git
synced 2026-08-24 19:29:52 +00:00
[nat64-translator] ensure expired mappings are released in timer callback (#11139)
This commit fixes the release of expired mappings by ensuring that `ReleaseExpiredMappings()` is always called from the timer callback `HandleMappingExpirerTimer()`, regardless of the logging level. Previously, `ReleaseExpiredMappings()` was called as an input to `LogInfo()`, which could become an empty macro (ignoring its input) if info-level logs were disabled.
This commit is contained in:
@@ -552,8 +552,13 @@ exit:
|
||||
|
||||
void Translator::HandleMappingExpirerTimer(void)
|
||||
{
|
||||
LogInfo("Released %d expired mappings", ReleaseExpiredMappings());
|
||||
uint16_t numReleased = ReleaseExpiredMappings();
|
||||
|
||||
LogInfo("Released %u expired mappings", numReleased);
|
||||
|
||||
mMappingExpirerTimer.Start(kAddressMappingIdleTimeoutMsec);
|
||||
|
||||
OT_UNUSED_VARIABLE(numReleased);
|
||||
}
|
||||
|
||||
void Translator::InitAddressMappingIterator(AddressMappingIterator &aIterator)
|
||||
|
||||
Reference in New Issue
Block a user