mirror of
https://github.com/espressif/openthread.git
synced 2026-11-10 00:11:20 +00:00
[br-tracker] initialize aMinAge to uint32_t::kMax (#11963)
In `NetDataPeerBrTracker::CountPeerBrs()` method, the `aMinAge` output parameter is a `uint32_t` but it was incorrectly initialized to `NumericLimits<uint16_t>::kMax`. This change corrects the initialization to use the `NumericLimits<uint32_t>::kMax` to ensure the minimum age calculation functions correctly over the full 32-bit range.
This commit is contained in:
@@ -49,7 +49,7 @@ uint16_t NetDataPeerBrTracker::CountPeerBrs(uint32_t &aMinAge) const
|
||||
uint32_t uptime = Get<Uptime>().GetUptimeInSeconds();
|
||||
uint16_t count = 0;
|
||||
|
||||
aMinAge = NumericLimits<uint16_t>::kMax;
|
||||
aMinAge = NumericLimits<uint32_t>::kMax;
|
||||
|
||||
for (const PeerBr &peerBr : mPeerBrs)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user