From 6dfef7e9b2f4bc8ab8415007726b27d484bc741e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Tue, 31 Aug 2010 18:51:57 +0000 Subject: [PATCH] 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 --- src/system/boot/loader/net/TCP.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/system/boot/loader/net/TCP.cpp b/src/system/boot/loader/net/TCP.cpp index 03e8c6baa4..ea2e9b2257 100644 --- a/src/system/boot/loader/net/TCP.cpp +++ b/src/system/boot/loader/net/TCP.cpp @@ -24,6 +24,8 @@ #include #include +#include "real_time_clock.h" + //#define TRACE_TCP //#define TRACE_TCP_RANDOMNESS @@ -46,7 +48,7 @@ _rand32(void) { static unsigned int next = 0; if (next == 0) - next = system_time() / 1000; + next = real_time_clock_usecs() / 1000000; next = (next >> 1) ^ (unsigned int)(-(next & 1U) & 0xd0000001U); // characteristic polynomial: x^32 + x^31 + x^29 + x + 1