From fb6fa2002a13c284bf6aeb899efd1a2dca4ba08f Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Wed, 24 Sep 2025 18:32:18 -0700 Subject: [PATCH] [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::kMax`. This change corrects the initialization to use the `NumericLimits::kMax` to ensure the minimum age calculation functions correctly over the full 32-bit range. --- src/core/border_router/br_tracker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/border_router/br_tracker.cpp b/src/core/border_router/br_tracker.cpp index 75f269dfb..d042e69c6 100644 --- a/src/core/border_router/br_tracker.cpp +++ b/src/core/border_router/br_tracker.cpp @@ -49,7 +49,7 @@ uint16_t NetDataPeerBrTracker::CountPeerBrs(uint32_t &aMinAge) const uint32_t uptime = Get().GetUptimeInSeconds(); uint16_t count = 0; - aMinAge = NumericLimits::kMax; + aMinAge = NumericLimits::kMax; for (const PeerBr &peerBr : mPeerBrs) {