MINOR: sample: make all bits random on the rand() sample fetch
authorWilly Tarreau <w@1wt.eu>
Sun, 8 Mar 2020 17:01:10 +0000 (18:01 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 8 Mar 2020 17:04:16 +0000 (18:04 +0100)
commitaa8bbc12ddcb134defd9a0216cf15de00d3a5e5a
tree7fefec81f873900ee586c9db55efe68888c80dc4
parent5a6d3e797edc7ac52560cc1a5bd90a984b6b350b
MINOR: sample: make all bits random on the rand() sample fetch

The rand() sample fetch supports being limited to a certain range, but
it only uses 31 bits and scales them as requested, which means that when
the requested output range is larger than 31 bits, the least significant
one is not random and may even be constant.

Let's make use of the whole 32 bits now that we have access ot them.
src/sample.c