summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-05-22 00:29:25 +0000
committerpfg <pfg@FreeBSD.org>2016-05-22 00:29:25 +0000
commitf0a486d17186001c93c08d3a3ad8b62498080196 (patch)
tree1366d29f6724e4fda5dfef0ebe7d9d127f3fd07b
parentce89d3075e1793c94e7a7345a2537a7dc817f91d (diff)
downloadFreeBSD-src-f0a486d17186001c93c08d3a3ad8b62498080196.zip
FreeBSD-src-f0a486d17186001c93c08d3a3ad8b62498080196.tar.gz
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
-rw-r--r--sys/compat/ndis/subr_ntoskrnl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/compat/ndis/subr_ntoskrnl.c b/sys/compat/ndis/subr_ntoskrnl.c
index 35f38a4..9b5e403 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);
}
OpenPOWER on IntegriCloud