]> git.baikalelectronics.ru Git - uboot.git/commit
net: make net_random_ethaddr() more random
authorMichael Walle <michael@walle.cc>
Tue, 27 Aug 2019 08:13:52 +0000 (10:13 +0200)
committerJoe Hershberger <joe.hershberger@ni.com>
Wed, 4 Sep 2019 16:37:19 +0000 (11:37 -0500)
commit51c13f517289f8b2e260ff1d73b58a035854de9d
tree5d9962b295fb126a6ebed0d04d67c61f7c3daecc
parent7c1505d7e3d2af90d69617d6ebc32db010014d96
net: make net_random_ethaddr() more random

The net_random_ethaddr() tries to get some entropy from different
startup times of a board. The seed is initialized with get_timer() which
has only a granularity of milliseconds. We can do better if we use
get_ticks() which returns the raw timer ticks. Using this we have a
higher chance of getting different values at startup.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
include/net.h