public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] Possible fix for dns command
Date: Wed, 23 Nov 2011 13:11:28 +0100	[thread overview]
Message-ID: <4ECCE2F0.9000106@denx.de> (raw)
In-Reply-To: <7767239ecce08457f16e9c20127fbc85.squirrel@www.inft.de>

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
=====================================================================

  reply	other threads:[~2011-11-23 12:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-16 12:37 [U-Boot] Possible fix for dns command Mathias Adam
2011-11-22 11:37 ` Mathias Adam
2011-11-22 19:01   ` Wolfgang Denk
2011-11-23 16:27     ` [U-Boot] [PATCH] Fix " Mathias Adam
2011-11-23 20:59       ` Graeme Russ
2011-11-23  9:57 ` [U-Boot] Possible fix for " Stefano Babic
2011-11-23 10:58   ` Mathias Adam
2011-11-23 12:11     ` Stefano Babic [this message]
2011-11-23 16:24       ` Mathias Adam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ECCE2F0.9000106@denx.de \
    --to=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox