aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJoe Hershberger2012-07-23 08:11:16 -0500
committerJoe Hershberger2012-07-24 14:09:40 -0500
commita03d63880578bc688c76dd5ac88e44dffbbb5262 (patch)
tree6e6987cde68728f7fc4f217127a59f5296ab66d1 /net
parent8b10652d6d9cc05023b5a6b73840078066f95a50 (diff)
downloadu-boot-a03d63880578bc688c76dd5ac88e44dffbbb5262.tar.gz
u-boot-a03d63880578bc688c76dd5ac88e44dffbbb5262.tar.xz
u-boot-a03d63880578bc688c76dd5ac88e44dffbbb5262.zip
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 <joe.hershberger@ni.com> Reported-by: Michael Walle <michael@walle.cc> Acked-by: Michael Walle <michael@walle.cc>
Diffstat (limited to 'net')
-rw-r--r--net/net.c3
1 files changed, 1 insertions, 2 deletions
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)
256#endif 256#endif
257 env_changed_id = env_id; 257 env_changed_id = env_id;
258 } 258 }
259 memcpy(NetOurEther, eth_get_dev()->enetaddr, 6);
259 260
260 return; 261 return;
261} 262}
@@ -322,8 +323,6 @@ int NetLoop(enum proto_t protocol)
322 } 323 }
323 324
324restart: 325restart:
325 memcpy(NetOurEther, eth_get_dev()->enetaddr, 6);
326
327 net_set_state(NETLOOP_CONTINUE); 326 net_set_state(NETLOOP_CONTINUE);
328 327
329 /* 328 /*