Fix braino of mine where the reseeds would happen far too often,

making the kernel process way too busy.

PR:             230808
Submitted by:   Conrad Meyer <cem@FreeBSD.org>
Reported by:    Danilo Egea Gondolfo <danilo@FreeBSD.org>
Reviewed by:	cem,delphij
Approved by:	re(rgrimes)
Approved by:	so(delphij)
MFC after:      1 Month
Security:	Yes
Differential Revision:	https://reviews.freebsd.org/D16872
This commit is contained in:
Mark Murray 2018-08-24 14:53:42 +00:00
parent c6c0be2765
commit 27064b30f2

View File

@ -371,7 +371,7 @@ random_fortuna_pre_read(void)
if (fortuna_state.fs_pool[0].fsp_length >= fortuna_state.fs_minpoolsize
#ifdef _KERNEL
/* FS&K - Use 'getsbinuptime()' to prevent reseed-spamming. */
&& (now - fortuna_state.fs_lasttime > hz/10)
&& (now - fortuna_state.fs_lasttime > SBT_1S/10)
#endif
) {
#ifdef _KERNEL