mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
LinuxKPI: add prandom_u32() as used by wireless drivers.
Sponsored by: The FreeBSD Foundation
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30435
(cherry picked from commit 10096cb606)
This commit is contained in:
parent
89f8a8c306
commit
17b99aa321
1 changed files with 9 additions and 0 deletions
|
|
@ -63,6 +63,15 @@ get_random_long(void)
|
|||
return (val);
|
||||
}
|
||||
|
||||
static __inline uint32_t
|
||||
prandom_u32(void)
|
||||
{
|
||||
uint32_t val;
|
||||
|
||||
get_random_bytes(&val, sizeof(val));
|
||||
return (val);
|
||||
}
|
||||
|
||||
static inline u32
|
||||
prandom_u32_max(u32 max)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue