Date: Thu, 18 Aug 2016 09:38:01 +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-11@freebsd.org Subject: svn commit: r304372 - stable/11/sys/dev/ntb/if_ntb Message-ID: <201608180938.u7I9c1c7099071@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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++; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608180938.u7I9c1c7099071>