bind9/lib
Ondřej Surý 8ddab7f0b8
Implement Fisher-Yates shuffle for nameserver selection
Replace the two-pass "random start index and wrap around" logic in
fctx_getaddresses_nameservers() with a statistically sound Fisher-Yates
shuffle.

The previous implementation picked a random starting node and did two
passes over the linked list to find query candidates.  The new logic
extracts the available nameservers into a bounded, stack-allocated array
of dns_rdata_t structures.

This array is then randomized in-place using a Fisher-Yates shuffle.
Finally, the shuffled array is traversed sequentially to launch fetches
until the dynamic quota (fctx->pending_running >= fetches_allowed) is
reached.

This guarantees a fair random distribution for outbound queries while
properly respecting dynamic query limits, entirely within O(1) memory
and without the overhead of linked-list pointer shuffling or multiple
dataset traversals.

(cherry picked from commit 3c33e7d937)
2026-02-26 08:17:23 +01:00
..
dns Implement Fisher-Yates shuffle for nameserver selection 2026-02-26 08:17:23 +01:00
isc Enforce NSEC3 record consistency 2026-02-24 17:10:52 +01:00
isccc Remove redundant parentheses from the return statement 2024-11-19 14:26:52 +01:00
isccfg standardize CHECK and RETERR macros 2025-12-03 19:17:20 -08:00
ns Clear serve-stale flags when following the CNAME chains 2026-02-25 11:30:34 +01:00
.gitignore The isc/platform.h header has been completely removed 2021-07-06 05:33:48 +00:00
Makefile.am Move irs_resconf into libdns and remove libirs 2023-02-24 09:38:59 +00:00