Skip to content

Commit 0d87dcc

Browse files
committed
Also fix countBefore(0xFFFFFFFF) to return _num
The signed comparison in countBefore breaks for the max uint32_t value. Even though callers now use getOutboundTotal(), the function itself should be correct for all inputs.
1 parent c7568a8 commit 0d87dcc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/helpers/StaticPoolPacketManager.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ PacketQueue::PacketQueue(int max_entries) {
99
}
1010

1111
int PacketQueue::countBefore(uint32_t now) const {
12+
if (now == 0xFFFFFFFF) return _num; // sentinel: count all entries regardless of schedule
13+
1214
int n = 0;
1315
for (int j = 0; j < _num; j++) {
1416
if ((int32_t)(_schedule_table[j] - now) > 0) continue; // scheduled for future... ignore for now

0 commit comments

Comments
 (0)