[U-Boot] Possible fix for dns command

Stefano Babic sbabic at denx.de
Wed Nov 23 13:11:28 CET 2011


On 23/11/2011 11:58, Mathias Adam wrote:
> Hi Stefano,
> 

Hi Matthias,

> 
> Just tried that: unfortunately it still doesn't work.
> 
> However, the problem I encountered is not that $dnsip wouldn't get set,
> this part worked correctly out of the box.

Ok, thanks to clarify this point.

>  But then, the dns command
> doesn't perform an ARP query to get the MAC address of the machine with IP
> $dnsip but instead uses whatever MAC address is stored in NetServerEther.

Understood, I see now. The main problem is that the MAC address is
already stored, and because there is not an ARP cache we cannot identify
which is the correct IP address.

> As mentioned before, I found that tftpboot does make an ARP query and
> stores the result in NetServerEther. In fact, when I start a "dummy" tftp
> access dns works, at least one time:

Ok, ARP does not return a valid MAC and the stored MAXC address is
removed. I see now. Then we should clear the MAC address before a DNS
query to force an ARP request.

>>> Forcing ARP queries before DNS fixed this (see patch below).
>>
>> I do not think this is correct.
> 
> hmm, not sure about u-boot, but generally I think it is a good idea to do
> an ARP query before sending packets to some IP address  ;-)

Sorry, it was not so clear to me after the first e-mail which was the
issue, and I was supposed u-boot does not take the DHCP option for DNS,
not setting the dnsip variable.

Now that the issue is clear and we agree on the solution, can you supply
a well-formed patch as requested by Wolfgang to be merged into mainline ?

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================


More information about the U-Boot mailing list