提交 b044cc1d 编写于 作者: J Jimmy Du 提交者: Joe Hershberger

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: NJimmy Du <jimmy.du@ni.com>
Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
上级 8f0b1693
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册