Make MAC address generation more random.

'ticks' approach does not work at boot time.
This commit is contained in:
Alexander Motin 2016-07-30 15:51:16 +00:00
parent cf2e151f65
commit 8260941c76

View file

@ -493,10 +493,9 @@ static void
create_random_local_eui48(u_char *eaddr)
{
static uint8_t counter = 0;
uint32_t seed = ticks;
eaddr[0] = EUI48_LOCALLY_ADMINISTERED;
memcpy(&eaddr[1], &seed, sizeof(uint32_t));
arc4rand(&eaddr[1], 4, 0);
eaddr[5] = counter++;
}