From: Willy Tarreau Date: Thu, 3 Mar 2022 17:01:26 +0000 (+0100) Subject: DEV: udp: add an optional argument to set the prng seed X-Git-Tag: v2.6-dev3~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c48c8b8701b9f05dc67633d3a4e2335e0d17c2a4;p=thirdparty%2Fhaproxy.git DEV: udp: add an optional argument to set the prng seed This will help reproduce certain sequences that were observed. --- diff --git a/dev/udp/udp-perturb.c b/dev/udp/udp-perturb.c index b6432575b8..824628d367 100644 --- a/dev/udp/udp-perturb.c +++ b/dev/udp/udp-perturb.c @@ -420,7 +420,7 @@ int main(int argc, char **argv) err.msg = malloc(err.size); if (argc < 3) - die(1, "Usage: %s [:] [:] [rand_rate%%]\n", argv[0]); + die(1, "Usage: %s [:] [:] [rand_rate%% [seed]]\n", argv[0]); if (addr_to_ss(argv[1], &frt_addr, &err) < 0) die(1, "parsing listen address: %s\n", err.msg); @@ -431,6 +431,9 @@ int main(int argc, char **argv) if (argc > 3) rand_rate = atoi(argv[3]); + if (argc > 4) + prng_state = atol(argv[4]); + pfd = calloc(sizeof(struct pollfd), MAXCONN + 1); if (!pfd) die(1, "out of memory\n");