]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: sample: make the rand() sample fetch function use the statistical_prng
authorWilly Tarreau <w@1wt.eu>
Thu, 24 Nov 2022 13:54:29 +0000 (14:54 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 24 Nov 2022 14:04:13 +0000 (15:04 +0100)
commit95f40c698d3ef3ad25fded5a7c35e2d108d2b542
tree2a25854fec5e4240f68950ec6aec52572c27b893
parent3cbf09ed6411d6e28020eefd91f0e70d5b64bcb5
MINOR: sample: make the rand() sample fetch function use the statistical_prng

Emeric noticed that producing many randoms to fill a stick table was
saturating on the rand_lock. Since 2.4 we have the statistical PRNG
for low-quality randoms like this one, there is no point in using the
one that was originally implemented for the purpose of creating safe
UUIDs, since the doc itself clearly states that these randoms are not
secure and they have not been in the past either. With this change,
locking contention is completely gone.
src/sample.c