pmlag

Poor man's link aggregation
git clone git://git.finwo.net/app/pmlag
Log | Files | Refs | README | LICENSE

commit 1105cc0c95cfc62d1abe9268c34980b04d3fb084
parent 5f935fbe6235e8caa4da30a2a6b50bcd76b29b31
Author: Robin Bron <robin@finwo.nl>
Date:   Wed,  8 Mar 2023 20:47:28 +0100

Seed random at start of program

Diffstat:
Msrc/main.c | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/main.c b/src/main.c @@ -28,6 +28,13 @@ static const char *const usage[] = { int main(int argc, const char **argv) { char *config_file="/etc/pmlag/pmlag.ini"; + // Seed random + unsigned int seed; + FILE* urandom = fopen("/dev/urandom", "r"); + fread(&seed, sizeof(int), 1, urandom); + fclose(urandom); + srand(seed); + // Define which options we support struct argparse_option options[] = { OPT_HELP(),