Module Name:    src
Committed By:   tls
Date:           Thu Aug 29 01:05:29 UTC 2013

Modified Files:
        src/sys/kern: kern_todr.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/kern/kern_todr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/kern_todr.c
diff -u src/sys/kern/kern_todr.c:1.34 src/sys/kern/kern_todr.c:1.35
--- src/sys/kern/kern_todr.c:1.34	Tue Feb  8 20:20:27 2011
+++ src/sys/kern/kern_todr.c	Thu Aug 29 01:05:29 2013
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: kern_todr.c,
 #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 @@ inittodr(time_t base)
 	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 @@ inittodr(time_t base)
 		} else {
 			goodtime = true;
 		}
+
+		rnd_add_data(NULL, &tv, sizeof(tv), 0);
 	}
 
 	/* if the rtc time is bad, use the filesystem time */

Reply via email to