]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: resolvers: switch to a better PRNG for query IDs
authorWilly Tarreau <w@1wt.eu>
Tue, 26 May 2026 07:30:12 +0000 (09:30 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 26 May 2026 11:13:24 +0000 (13:13 +0200)
commit2a47cab7f3e7d50d435f4e657af7317a35f51308
treeeb79eb76b40b9976017234ea6c061d2773c5a1fe
parentc41c731f5e0048ff9d79b5f2b009e0a53cafb6ef
BUG/MINOR: resolvers: switch to a better PRNG for query IDs

The PRNG used by the DNS currently is easily predictable once an
observer can collect a few consecutive IDs from the same thread, since
it's a 32-bit xorshift reduced to 16 bits output. Let's switch it to
ha_random32() instead.

This should be backported, however on older releases the ha_random32()
cost is higher due to the lock involved.
src/resolvers.c