mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Make MAC address generation more random.
'ticks' approach does not work at boot time.
This commit is contained in:
parent
cf2e151f65
commit
8260941c76
1 changed files with 1 additions and 2 deletions
|
|
@ -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++;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue