[U-Boot] [PATCH] Fix dns command

Mathias Adam m.adam--uboot at adamis.de
Wed Nov 23 17:27:56 CET 2011


The dns command didn't perform an ARP query to get the MAC address of
the DNS server if a MAC address was already stored in NetServerEther.
In that case the stored address was used no matter what IP address it
belongs to.

With this patch, NetServerEther is being cleared before a DNS query to
force an ARP request.

Signed-off-by: Mathias Adam <m.adam--uboot at adamis.de>
---
 net/dns.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/dns.c b/net/dns.c
index 7a3f1f9..9d79d7d 100644
--- a/net/dns.c
+++ b/net/dns.c
@@ -202,5 +202,8 @@ DnsStart(void)
 	NetSetTimeout(DNS_TIMEOUT, DnsTimeout);
 	NetSetHandler(DnsHandler);

+	/* zero out server ether in case the server ip has changed */
+	memset(NetServerEther, 0, 6);
+
 	DnsSend();
 }




More information about the U-Boot mailing list