Source-Changes-HG archive

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

[src/trunk]: src/sys/lib/libkern Account bytes drawn from initial call to lib...



details:   https://anonhg.NetBSD.org/src/rev/ff9d79dfa69e
branches:  trunk
changeset: 787546:ff9d79dfa69e
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Jun 23 02:38:22 2013 +0000

description:
Account bytes drawn from initial call to libkern arc4random.

XXX This unlocked initialization looks rather bogus...

diffstat:

 sys/lib/libkern/arc4random.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (17 lines):

diff -r 3c1ccd884280 -r ff9d79dfa69e sys/lib/libkern/arc4random.c
--- a/sys/lib/libkern/arc4random.c      Sun Jun 23 02:35:23 2013 +0000
+++ b/sys/lib/libkern/arc4random.c      Sun Jun 23 02:38:22 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arc4random.c,v 1.33 2013/06/23 02:35:24 riastradh Exp $        */
+/*     $NetBSD: arc4random.c,v 1.34 2013/06/23 02:38:22 riastradh Exp $        */
 
 /*-
  * Copyright (c) 2002, 2011 The NetBSD Foundation, Inc.
@@ -251,6 +251,7 @@
                arc4_init();
                /* avoid conditionalizing locking */
                arc4randbytes_unlocked(p, len);
+               arc4_numbytes += len;
                return;
        }
        mutex_spin_enter(&arc4_mtx);



Home | Main Index | Thread Index | Old Index