From: Joe Hershberger Date: Mon, 23 Jul 2012 13:11:16 +0000 (+0000) Subject: net: Make sure the ethaddr is updated in net_init() X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=a03d63880578bc688c76dd5ac88e44dffbbb5262;p=u-boot.git net: Make sure the ethaddr is updated in net_init() NetConsole may call NetSendUDPPacket before NetLoop is called. This will cause the source MAC address (NetOurEther) to be wrong. Instead of only changing it in NetLoop, move it to NetLoopInit so that it is also updated when net_init() is called (especially by nc_start()). Signed-off-by: Joe Hershberger Reported-by: Michael Walle Acked-by: Michael Walle --- diff --git a/net/net.c b/net/net.c index 9de7d92643..e8ff0662b8 100644 --- a/net/net.c +++ b/net/net.c @@ -256,6 +256,7 @@ static void NetInitLoop(void) #endif env_changed_id = env_id; } + memcpy(NetOurEther, eth_get_dev()->enetaddr, 6); return; } @@ -322,8 +323,6 @@ int NetLoop(enum proto_t protocol) } restart: - memcpy(NetOurEther, eth_get_dev()->enetaddr, 6); - net_set_state(NETLOOP_CONTINUE); /*