All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] net: Make sure the ethaddr is updated in net_init()
@ 2012-07-23 23:11 Joe Hershberger
  2012-07-23 23:33 ` Joe Hershberger
  2012-07-24 11:11 ` Michael Walle
  0 siblings, 2 replies; 3+ messages in thread
From: Joe Hershberger @ 2012-07-23 23:11 UTC (permalink / raw)
  To: u-boot

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>
---
 net/net.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/net/net.c b/net/net.c
index 9de7d92..e8ff066 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);
 
 	/*
-- 
1.6.0.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] net: Make sure the ethaddr is updated in net_init()
  2012-07-23 23:11 [U-Boot] [PATCH] net: Make sure the ethaddr is updated in net_init() Joe Hershberger
@ 2012-07-23 23:33 ` Joe Hershberger
  2012-07-24 11:11 ` Michael Walle
  1 sibling, 0 replies; 3+ messages in thread
From: Joe Hershberger @ 2012-07-23 23:33 UTC (permalink / raw)
  To: u-boot

Hi Michael,

On Mon, Jul 23, 2012 at 6:11 PM, Joe Hershberger <joe.hershberger@ni.com> wrote:
> 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>
> ---

Please test this and verify that it solves your issue.

Thanks
-Joe

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] net: Make sure the ethaddr is updated in net_init()
  2012-07-23 23:11 [U-Boot] [PATCH] net: Make sure the ethaddr is updated in net_init() Joe Hershberger
  2012-07-23 23:33 ` Joe Hershberger
@ 2012-07-24 11:11 ` Michael Walle
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Walle @ 2012-07-24 11:11 UTC (permalink / raw)
  To: u-boot

On Tue, July 24, 2012 01:11, Joe Hershberger wrote:
> 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>
> ---
>  net/net.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/net/net.c b/net/net.c
> index 9de7d92..e8ff066 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;
>  }

This was exactly my (quick) fix, too. Therefore,

Acked-by: Michael Walle <michael@walle.cc>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-07-24 11:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-23 23:11 [U-Boot] [PATCH] net: Make sure the ethaddr is updated in net_init() Joe Hershberger
2012-07-23 23:33 ` Joe Hershberger
2012-07-24 11:11 ` Michael Walle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.