]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: init: Initialize random seed earlier in the init process
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Mon, 11 Aug 2025 13:55:35 +0000 (15:55 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 11 Aug 2025 14:02:41 +0000 (16:02 +0200)
commit15ee49e8222be2b34663fac838aa74e62f6c82ea
treef96c12a956102eedf27115d0440343c39d32e197
parent84589a9f48963efe76a4c6dcd21b8dbc71c296e0
BUG/MINOR: init: Initialize random seed earlier in the init process

The random seed used in ha_random functions needs to be first
initialized by calling ha_random_boot. This function was called rather
late in the init process, after the init functions (INITCALLS) are
called and after the configuration parsing for instance which means that
any ha_random call in an init function would return 0. This was the case
in 'vars_init' and 'cache_init' which tried to build seeds for specific
hash calculations but ended up not being seeded.

This patch can be backported on all stable branches.
src/haproxy.c