diff options
author | Pedro F. Giffuni <pfg@FreeBSD.org> | 2016-05-22 00:29:25 +0000 |
---|---|---|
committer | Pedro F. Giffuni <pfg@FreeBSD.org> | 2016-05-22 00:29:25 +0000 |
commit | b9c52b50a7ceb5bb43399df3b224e41e28019277 (patch) | |
tree | 1366d29f6724e4fda5dfef0ebe7d9d127f3fd07b | |
parent | cd7d06ac7ead1b6d3688d699dcc9c6c56d654ec7 (diff) | |
download | src-b9c52b50a7ceb5bb43399df3b224e41e28019277.tar.gz src-b9c52b50a7ceb5bb43399df3b224e41e28019277.zip |
ndis(4): adjustments for our random() specific implementation.
- Revert r300377: The implementation claims to return a value
within the range. [1]
- Adjust the value for the case of a zero seed, whihc according
to standards should be equivalent to a seed of value 1.
Pointed out by: cem
Notes
Notes:
svn path=/head/; revision=300384
-rw-r--r-- | sys/compat/ndis/subr_ntoskrnl.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/compat/ndis/subr_ntoskrnl.c b/sys/compat/ndis/subr_ntoskrnl.c index 35f38a463876..9b5e40344f82 100644 --- a/sys/compat/ndis/subr_ntoskrnl.c +++ b/sys/compat/ndis/subr_ntoskrnl.c @@ -3189,13 +3189,15 @@ static int rand(void) { - return (random() / 2 + 1); + return (random()); } static void srand(unsigned int seed) { + if (seed == 0) + seed = 1; srandom(seed); } |