summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorJimmy Du <jimmy.du@ni.com>2017-06-06 11:58:54 -0500
committerJoe Hershberger <joe.hershberger@ni.com>2017-08-07 15:18:28 -0500
commitb044cc1dee8f8af4dcad6ca2ef3ff4f577b79229 (patch)
treef0469af07c90e4830a28f70f14e81c323856ab2b /net
parent8f0b169382734d0f1f7bf89ec1e686e51a75cd67 (diff)
downloadu-boot-b044cc1dee8f8af4dcad6ca2ef3ff4f577b79229.tar.gz
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>
Diffstat (limited to 'net')
-rw-r--r--net/net_rand.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/net_rand.h b/net/net_rand.h
index ba9d0642cf..4bf9bd817e 100644
--- a/net/net_rand.h
+++ b/net/net_rand.h
@@ -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;