From c7c176394ad2b87f56b0aed2731eb9dde29750f0 Mon Sep 17 00:00:00 2001 From: Matteo Croce Date: Tue, 21 Aug 2018 16:38:09 +0200 Subject: mausezahn: improve random mac address generation Modify -b option to generate all random MAC addresses. Improve the random generation algorithm, use nrand48() which fills the ethernet address in two calls instead of six calls to rand() and six floating point calculations. Set the locally administered bit of generated MAC addresses. Signed-off-by: Matteo Croce Signed-off-by: Tobias Klauser --- staging/mausezahn.c | 1 + 1 file changed, 1 insertion(+) (limited to 'staging/mausezahn.c') diff --git a/staging/mausezahn.c b/staging/mausezahn.c index d3d037b..80bfe7d 100644 --- a/staging/mausezahn.c +++ b/staging/mausezahn.c @@ -339,6 +339,7 @@ int reset(void) // Initialize random generator time(&t); srand((unsigned int)t); + srand48(t); // Reset device_list for (i=0; i