mirror of
https://xff.cz/git/u-boot/
synced 2025-08-31 08:12:06 +02:00
net: Get mac address from driver as seed
Previously seeded by obtaining mac addr from env. If mac addr was never set, rand would output 0. This fix obtains the mac addr from driver instead. Signed-off-by: Jimmy Du <jimmy.du@ni.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
committed by
Joe Hershberger
parent
8f0b169382
commit
b044cc1dee
@@ -16,11 +16,11 @@
|
||||
*/
|
||||
static inline unsigned int seed_mac(void)
|
||||
{
|
||||
unsigned char enetaddr[6];
|
||||
unsigned char enetaddr[ARP_HLEN];
|
||||
unsigned int seed;
|
||||
|
||||
/* get our mac */
|
||||
eth_getenv_enetaddr("ethaddr", enetaddr);
|
||||
memcpy(enetaddr, eth_get_ethaddr(), ARP_HLEN);
|
||||
|
||||
seed = enetaddr[5];
|
||||
seed ^= enetaddr[4] << 8;
|
||||
|
Reference in New Issue
Block a user