Add zeek::max_random() & fix misuse of RAND_MAX w/ zeek::random_number()

In deterministic mode, RAND_MAX is not related to the result of
zeek::random_number() (formerly bro_random()), but some logic was
using RAND_MAX as indication of the possible range of values.  The
new zeek::max_random() will give the correct upper-bound regardless
of whether deterministic-mode is used.
This commit is contained in:
Jon Siwek 2020-07-22 09:57:56 -07:00
parent bde38893ce
commit d486af06b1
6 changed files with 24 additions and 9 deletions

View file

@ -34,7 +34,7 @@ public:
private:
struct Filter {
uint32_t tcp_flags;
uint32_t probability;
double probability;
};
static void DeleteFilter(void* data);