diff --git a/src/core/thread/router_table.cpp b/src/core/thread/router_table.cpp index b9bbc1386..2eb60eba7 100644 --- a/src/core/thread/router_table.cpp +++ b/src/core/thread/router_table.cpp @@ -115,7 +115,7 @@ void RouterTable::UpdateAllocation(void) // build index map for (uint8_t i = 0; i <= Mle::kMaxRouterId; i++) { - if (IsAllocated(i)) + if (IsAllocated(i) && mActiveRouterCount < Mle::kMaxRouters) { indexMap[i] = mActiveRouterCount++; }