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

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Jun 4 04:03:06 UTC 2016


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

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

Author: pfg
Date: Sat Jun  4 04:02:03 UTC 2016
New revision: 301299
URL: https://svnweb.freebsd.org/changeset/base/301299

Log:
  MFC r300376:
  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

Changes:
_U  stable/9/sys/
  stable/9/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