Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Jul 2016 15:51:16 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r303553 - head/sys/dev/ntb/if_ntb
Message-ID:  <201607301551.u6UFpGAH090362@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sat Jul 30 15:51:16 2016
New Revision: 303553
URL: https://svnweb.freebsd.org/changeset/base/303553

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

Modified:
  head/sys/dev/ntb/if_ntb/if_ntb.c

Modified: head/sys/dev/ntb/if_ntb/if_ntb.c
==============================================================================
--- head/sys/dev/ntb/if_ntb/if_ntb.c	Sat Jul 30 14:47:04 2016	(r303552)
+++ head/sys/dev/ntb/if_ntb/if_ntb.c	Sat Jul 30 15:51:16 2016	(r303553)
@@ -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++;
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607301551.u6UFpGAH090362>