Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Mix in boot time (wherever we may find it). Helps ...



details:   https://anonhg.NetBSD.org/src/rev/3e3fda191a40
branches:  trunk
changeset: 789637:3e3fda191a40
user:      tls <tls%NetBSD.org@localhost>
date:      Thu Aug 29 01:05:29 2013 +0000

description:
Mix in boot time (wherever we may find it).  Helps avoid predictable output
on young systems.

diffstat:

 sys/kern/kern_todr.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (44 lines):

diff -r f0d85541fd7f -r 3e3fda191a40 sys/kern/kern_todr.c
--- a/sys/kern/kern_todr.c      Thu Aug 29 01:04:49 2013 +0000
+++ b/sys/kern/kern_todr.c      Thu Aug 29 01:05:29 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_todr.c,v 1.34 2011/02/08 20:20:27 rmind Exp $     */
+/*     $NetBSD: kern_todr.c,v 1.35 2013/08/29 01:05:29 tls Exp $       */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_todr.c,v 1.34 2011/02/08 20:20:27 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_todr.c,v 1.35 2013/08/29 01:05:29 tls Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -47,6 +47,7 @@
 #include <sys/device.h>
 #include <sys/timetc.h>
 #include <sys/intr.h>
+#include <sys/rnd.h>
 
 #include <dev/clock_subr.h>    /* hmm.. this should probably move to sys */
 
@@ -82,6 +83,8 @@
        struct timespec ts;
        struct timeval tv;
 
+       rnd_add_data(NULL, &base, sizeof(base), 0);
+
        if (base < 5 * SECYR) {
                struct clock_ymdhms basedate;
 
@@ -143,6 +146,8 @@
                } else {
                        goodtime = true;
                }
+
+               rnd_add_data(NULL, &tv, sizeof(tv), 0);
        }
 
        /* if the rtc time is bad, use the filesystem time */



Home | Main Index | Thread Index | Old Index