From 8260941c76193b4e2c40dcc439526b269e9f208e Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Sat, 30 Jul 2016 15:51:16 +0000 Subject: [PATCH] Make MAC address generation more random. 'ticks' approach does not work at boot time. --- sys/dev/ntb/if_ntb/if_ntb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/ntb/if_ntb/if_ntb.c b/sys/dev/ntb/if_ntb/if_ntb.c index 586b509f5a0..c67ae0dc682 100644 --- a/sys/dev/ntb/if_ntb/if_ntb.c +++ b/sys/dev/ntb/if_ntb/if_ntb.c @@ -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++; }