Skip to content

Commit

Permalink
Merge pull request #8 from pwdraper/master
Browse files Browse the repository at this point in the history
Restrict range of sequence number to 24 bits
  • Loading branch information
claudebarthels authored Aug 3, 2020
2 parents 72947b8 + 3bea371 commit c6cbbbf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/infinity/queues/QueuePair.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ QueuePair::QueuePair(infinity::core::Context* context) :
INFINITY_ASSERT(returnValue == 0, "[INFINITY][QUEUES][QUEUEPAIR] Cannot transition to INIT state.\n");

std::random_device randomGenerator;
this->sequenceNumber = randomGenerator();
std::uniform_int_distribution<int> range(0, 1<<24);
this->sequenceNumber = range(randomGenerator);

this->userData = NULL;
this->userDataSize = 0;
Expand Down

0 comments on commit c6cbbbf

Please sign in to comment.