From owner-svn-src-head@freebsd.org Sat Oct 20 21:06:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A77DEFF5D30; Sat, 20 Oct 2018 21:06:16 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D05B890D8; Sat, 20 Oct 2018 21:06:16 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4265023686; Sat, 20 Oct 2018 21:06:16 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KL6GbN024115; Sat, 20 Oct 2018 21:06:16 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KL6GIo024114; Sat, 20 Oct 2018 21:06:16 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810202106.w9KL6GIo024114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 20 Oct 2018 21:06:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339491 - head/sys/dev/random X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/random X-SVN-Commit-Revision: 339491 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2018 21:06:16 -0000 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));