Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Oct 2018 21:06:16 +0000 (UTC)
From:      Conrad Meyer <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r339491 - head/sys/dev/random
Message-ID:  <201810202106.w9KL6GIo024114@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cem
Date: Sat Oct 20 21:06:15 2018
New Revision: 339491
URL: https://svnweb.freebsd.org/changeset/base/339491

Log:
  random(4): Correct a bare zero to the appropriate enum
  
  The convention for updating hc_destination[] is to index with a
  random_entropy_source.  Zero happens to match RANDOM_CACHED, which is
  correct for this source (early random data).  Spell the zero value as the
  enum name instead of the magic constant.
  
  No functional change.
  
  Reviewed by:	delphij, markm
  Approved by:	secteam (delphij)
  Sponsored by:	Dell EMC Isilon
  Differential Revision:	https://reviews.freebsd.org/D16983

Modified:
  head/sys/dev/random/random_harvestq.c

Modified: head/sys/dev/random/random_harvestq.c
==============================================================================
--- head/sys/dev/random/random_harvestq.c	Sat Oct 20 20:53:35 2018	(r339490)
+++ head/sys/dev/random/random_harvestq.c	Sat Oct 20 21:06:15 2018	(r339491)
@@ -414,7 +414,8 @@ random_harvestq_prime(void *unused __unused)
 				event.he_somecounter = (uint32_t)get_cyclecount();
 				event.he_size = count;
 				event.he_source = RANDOM_CACHED;
-				event.he_destination = harvest_context.hc_destination[0]++;
+				event.he_destination =
+				    harvest_context.hc_destination[RANDOM_CACHED]++;
 				memcpy(event.he_entropy, data + i, sizeof(event.he_entropy));
 				random_harvestq_fast_process_event(&event);
 				explicit_bzero(&event, sizeof(event));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201810202106.w9KL6GIo024114>