boot_net: Use real_time_clock_usecs() for TCP
Initialize the PRNG seed for the sequence number with real_time_clock_usecs() rather than system_time(). The remaining uses of system_time() for timeout calculation match UDP. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38482 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -24,6 +24,8 @@
|
|||||||
#include <boot/net/ChainBuffer.h>
|
#include <boot/net/ChainBuffer.h>
|
||||||
#include <boot/net/NetStack.h>
|
#include <boot/net/NetStack.h>
|
||||||
|
|
||||||
|
#include "real_time_clock.h"
|
||||||
|
|
||||||
|
|
||||||
//#define TRACE_TCP
|
//#define TRACE_TCP
|
||||||
//#define TRACE_TCP_RANDOMNESS
|
//#define TRACE_TCP_RANDOMNESS
|
||||||
@@ -46,7 +48,7 @@ _rand32(void)
|
|||||||
{
|
{
|
||||||
static unsigned int next = 0;
|
static unsigned int next = 0;
|
||||||
if (next == 0)
|
if (next == 0)
|
||||||
next = system_time() / 1000;
|
next = real_time_clock_usecs() / 1000000;
|
||||||
|
|
||||||
next = (next >> 1) ^ (unsigned int)(-(next & 1U) & 0xd0000001U);
|
next = (next >> 1) ^ (unsigned int)(-(next & 1U) & 0xd0000001U);
|
||||||
// characteristic polynomial: x^32 + x^31 + x^29 + x + 1
|
// characteristic polynomial: x^32 + x^31 + x^29 + x + 1
|
||||||
|
|||||||
Reference in New Issue
Block a user