From 4c9547cd12b5bb569f10b368eb6bb04d897d596f Mon Sep 17 00:00:00 2001 From: Erwin Lansing Date: Mon, 15 Dec 2014 12:14:41 +0000 Subject: Vendor import of BIND 9.9.6-P1 Sponsored by: DK Hostmaster A/S --- lib/isc/random.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lib/isc/random.c') diff --git a/lib/isc/random.c b/lib/isc/random.c index 4c48e60fd77d..d18204d6e337 100644 --- a/lib/isc/random.c +++ b/lib/isc/random.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2007, 2009, 2013 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2007, 2009, 2013, 2014 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -67,8 +67,16 @@ isc_random_seed(isc_uint32_t seed) #ifndef HAVE_ARC4RANDOM srand(seed); -#else +#elif defined(HAVE_ARC4RANDOM_ADDRANDOM) arc4random_addrandom((u_char *) &seed, sizeof(isc_uint32_t)); +#else + /* + * If arcrandom() is available and no corresponding seeding + * function arc4random_addrandom() is available, no seeding is + * done on such platforms (e.g., OpenBSD 5.5). This is because + * the OS itself is supposed to seed the RNG and it is assumed + * that no explicit seeding is required. + */ #endif } -- cgit v1.2.3