svn commit: r304372 - stable/11/sys/dev/ntb/if_ntb

Alexander Motin mav at FreeBSD.org
Thu Aug 18 09:38:02 UTC 2016


Author: mav
Date: Thu Aug 18 09:38:01 2016
New Revision: 304372
URL: https://svnweb.freebsd.org/changeset/base/304372

Log:
  MFC r303553: Make MAC address generation more random.
  
  'ticks' approach does not work at boot time.

Modified:
  stable/11/sys/dev/ntb/if_ntb/if_ntb.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/ntb/if_ntb/if_ntb.c
==============================================================================
--- stable/11/sys/dev/ntb/if_ntb/if_ntb.c	Thu Aug 18 09:37:27 2016	(r304371)
+++ stable/11/sys/dev/ntb/if_ntb/if_ntb.c	Thu Aug 18 09:38:01 2016	(r304372)
@@ -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++;
 }
 


More information about the svn-src-stable mailing list