Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Aug 2016 11:02:42 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r304408 - stable/10/sys/dev/ntb/if_ntb
Message-ID:  <201608181102.u7IB2gwc034871@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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++;
 }
 



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