summaryrefslogtreecommitdiff
path: root/usr.sbin/bind
diff options
context:
space:
mode:
authorJakob Schlyter <jakob@cvs.openbsd.org>2003-01-20 21:29:27 +0000
committerJakob Schlyter <jakob@cvs.openbsd.org>2003-01-20 21:29:27 +0000
commit80ca516330904d2aee1365d9f69019bebaad352a (patch)
tree70020ca9696403ce2866369c4fb1a518b4f1441a /usr.sbin/bind
parentf04ce03827c60cbd08a590c280618e260e5dd700 (diff)
use isc_random_get instead of rand()
Diffstat (limited to 'usr.sbin/bind')
-rw-r--r--usr.sbin/bind/lib/dns/rdataset.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/bind/lib/dns/rdataset.c b/usr.sbin/bind/lib/dns/rdataset.c
index 85bfc6b0cd7..d9b5d6c4012 100644
--- a/usr.sbin/bind/lib/dns/rdataset.c
+++ b/usr.sbin/bind/lib/dns/rdataset.c
@@ -363,7 +363,11 @@ towiresorted(dns_rdataset_t *rdataset, dns_name_t *owner_name,
/*
* "Cyclic" order.
*/
- unsigned int j = (((unsigned int)rand()) >> 3) % count;
+ isc_uint32_t val;
+ unsigned int j;
+
+ isc_random_get(&val);
+ j = val % count;
for (i = 0; i < count; i++) {
sorted[j].key = 0; /* Unused */
sorted[j].rdata = &shuffled[i];