From: Siva Durga Prasad Paladugu Date: Wed, 2 Nov 2016 11:52:13 +0000 (+0100) Subject: net: use random ethernet address if invalid and not zero X-Git-Tag: v2016.11~18^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=aa555fe9f07a21b3bbdab15aea594f3869e5ab22;p=u-boot net: use random ethernet address if invalid and not zero Use random ethernet address if the ethernet address found is invalid, not zero and config for random address is defined. Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek Acked-by: Joe Hershberger --- diff --git a/net/eth-uclass.c b/net/eth-uclass.c index a32961e6ce..1d13011089 100644 --- a/net/eth-uclass.c +++ b/net/eth-uclass.c @@ -512,7 +512,8 @@ static int eth_post_probe(struct udevice *dev) eth_setenv_enetaddr_by_index("eth", dev->seq, pdata->enetaddr); printf("\nWarning: %s using MAC address from ROM\n", dev->name); - } else if (is_zero_ethaddr(pdata->enetaddr)) { + } else if (is_zero_ethaddr(pdata->enetaddr) || + !is_valid_ethaddr(pdata->enetaddr)) { #ifdef CONFIG_NET_RANDOM_ETHADDR net_random_ethaddr(pdata->enetaddr); printf("\nWarning: %s (eth%d) using random MAC address - %pM\n",