Mask out random bits when doing queue ordering (#4561)

* Mask out random bits when doing queue ordering

* Parenthesis
This commit is contained in:
Jonathan Bennett
2024-08-26 15:48:47 -05:00
committed by GitHub
parent 5824a8f4c1
commit b9a8683a4b
3 changed files with 8 additions and 6 deletions

View File

@@ -109,7 +109,7 @@ PacketId generatePacketId()
rollingPacketId++;
rollingPacketId &= UINT32_MAX >> 22; // Mask out the top 22 bits
rollingPacketId &= ID_COUNTER_MASK; // Mask out the top 22 bits
PacketId id = rollingPacketId | random(UINT32_MAX & 0x7fffffff) << 10; // top 22 bits
LOG_DEBUG("Partially randomized packet id %u\n", id);
return id;