Commit dec3e2e8 authored by João Valverde's avatar João Valverde Committed by João Valverde

randpkt_core: Use g_random_* for randpkt_parse_type().

randpkt_parse_type() can (and most likely will) be called before
randpkt_example_init(), therefore g_rand_int_range is called with a NULL
GRand argument. This produces non-random output.

Change-Id: Id420edc15a5f9dec427c5f1a1dd9a1f18a225319
Reviewed-on: default avatarJoão Valverde <>
parent 3ea8ccf6
......@@ -723,7 +723,7 @@ int randpkt_parse_type(char *string)
/* Called with NULL, choose a random packet */
if (!string) {
return examples[g_rand_int_range(pkt_rand, 0, num_entries)].produceable_type;
return examples[g_random_int_range(0, num_entries)].produceable_type;
for (i = 0; i < num_entries; i++) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment