mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-02 23:55:27 +00:00
Only get one random number per response when order == random
This commit is contained in:
committed by
Ondřej Surý
parent
9c4fb3b3e6
commit
f7986c8d1a
@@ -409,9 +409,8 @@ towiresorted(dns_rdataset_t *rdataset, const dns_name_t *owner_name,
|
|||||||
/*
|
/*
|
||||||
* 'Random' order.
|
* 'Random' order.
|
||||||
*/
|
*/
|
||||||
|
isc_uint32_t val = isc_random32();
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
isc_uint32_t val = isc_random32();
|
|
||||||
|
|
||||||
choice = i + val % (count - i);
|
choice = i + val % (count - i);
|
||||||
rdata = in[i];
|
rdata = in[i];
|
||||||
in[i] = in[choice];
|
in[i] = in[choice];
|
||||||
|
Reference in New Issue
Block a user