[Bug 209616] [ndis][patch] compat/ndis rand() doesn't respect the seed

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat May 21 17:38:57 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209616

--- Comment #5 from commit-hook at freebsd.org ---
A commit references this bug:

Author: pfg
Date: Sat May 21 17:38:44 UTC 2016
New revision: 300376
URL: https://svnweb.freebsd.org/changeset/base/300376

Log:
  ndis(4): Better mimic the behavior of rand() on Windows.

  In ndis(4) we expose a rand() function that was constantly reseeding
  with a time depending function every time it was called. This
  essentially broke the reasoning behind seeding, and rendered srand()
  a no-op.

  Keep it simple, just use random() and srandom() as it's meant to work.
  It  would have been tempting to just go for arc4random() but we
  want to mimic Microsoft, and we don't need crypto-grade randomness
  here.

  PR:           209616
  MFC after:    2 weeks

Changes:
  head/sys/compat/ndis/subr_ntoskrnl.c

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list