From owner-svn-src-head@freebsd.org Sun May 22 00:29:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0345B45B51; Sun, 22 May 2016 00:29:26 +0000 (UTC) (envelope-from pfg@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 mx1.freebsd.org (Postfix) with ESMTPS id BDBFD1EDC; Sun, 22 May 2016 00:29:26 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4M0TPsZ050124; Sun, 22 May 2016 00:29:25 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4M0TPI6050123; Sun, 22 May 2016 00:29:25 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605220029.u4M0TPI6050123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 22 May 2016 00:29:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300384 - head/sys/compat/ndis X-SVN-Group: head 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.22 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: Sun, 22 May 2016 00:29:27 -0000 Author: pfg Date: Sun May 22 00:29:25 2016 New Revision: 300384 URL: https://svnweb.freebsd.org/changeset/base/300384 Log: ndis(4): adjustments for our random() specific implementation. - Revert r300377: The implementation claims to return a value within the range. [1] - Adjust the value for the case of a zero seed, whihc according to standards should be equivalent to a seed of value 1. Pointed out by: cem Modified: head/sys/compat/ndis/subr_ntoskrnl.c Modified: head/sys/compat/ndis/subr_ntoskrnl.c ============================================================================== --- head/sys/compat/ndis/subr_ntoskrnl.c Sat May 21 23:21:42 2016 (r300383) +++ head/sys/compat/ndis/subr_ntoskrnl.c Sun May 22 00:29:25 2016 (r300384) @@ -3189,13 +3189,15 @@ static int rand(void) { - return (random() / 2 + 1); + return (random()); } static void srand(unsigned int seed) { + if (seed == 0) + seed = 1; srandom(seed); }