From d566bf5217344fb863566ccd6ab0daa6fbd9c8fb Mon Sep 17 00:00:00 2001 From: adilger Date: Sat, 28 Jan 2006 01:14:38 +0000 Subject: [PATCH] Branch b_release_1_4_6 Description: Random seed of liblustre clients was not sufficiently random Details : Improve initial seed of liblustre random number generator. b=9794, tested by Cray --- lustre/ChangeLog | 6 ++++++ lustre/liblustre/lutil.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index d6c56ba..4a6bdc8 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -531,6 +531,12 @@ Details : The client ptlrpc code may be trying to reconnect to a down timeout interval to avoid sending duplicate connections to servers. +Severity : minor +Frequency : liblustre only +Bugzilla : 9794 +Description: Random seed of liblustre clients was not sufficiently random +Details : Improve initial seed of liblustre random number generator. + ------------------------------------------------------------------------------ 08-26-2005 Cluster File Systems, Inc. diff --git a/lustre/liblustre/lutil.c b/lustre/liblustre/lutil.c index 17e54ec..b4689d5 100644 --- a/lustre/liblustre/lutil.c +++ b/lustre/liblustre/lutil.c @@ -126,7 +126,7 @@ void liblustre_init_random() seed[0] = _my_pnid; #endif gettimeofday(&tv, NULL); - ll_srand(tv.tv_usec | __swab32(getpid()), tv.tv_sec|__swab32(seed[0])); + ll_srand(tv.tv_sec ^ __swab32(seed[0]), tv.tv_usec ^__swab32(getpid())); } void get_random_bytes(void *buf, int size) -- 1.8.3.1