Author: mav
Date: Thu Aug 18 11:02:42 2016
New Revision: 304408
URL: https://svnweb.freebsd.org/changeset/base/304408
Log:
MFC r303553: Make MAC address generation more random.
'ticks' approach does not work at boot time.
Modified:
stable/10/sys/dev/ntb/if_ntb/if_ntb.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/dev/ntb/if_ntb/if_ntb.c
==============================================================================
--- stable/10/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 11:02:01 2016
(r304407)
+++ stable/10/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 11:02:42 2016
(r304408)
@@ -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++;
}
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"