[U-Boot] Possible fix for dns command

Stefano Babic sbabic at denx.de
Wed Nov 23 10:57:33 CET 2011


On 16/11/2011 13:37, Mathias Adam wrote:
> Hello,
> 
Hi,

> I'm currently using u-boot on a TI DM816x evaluation board (u-boot as
> included in TI's EZSDK 5.02). I manually enabled CONFIG_CMD_DNS. However,
> running dhcp followed by dns <some_host_name> only gave timeouts.
> 
> I found (using #define DEBUG) that DNS UDP queries are being sent to the
> MAC of the DHCP server -- which is not equal to the DNS server, hence the
> timeouts.

I have checked this issue, but I am coming to a different conclusion. I
have sniffed the network between the DHCP server and the target, and the
target is able to recognize the option 6 (DNS - name server) of the DHCP
OFFER.

However, the code setting the variable using by the DNS command
("dnsip") is not set if a file is not loaded by the TFTP server.

In cmd_net.c, you see:

        if ((size = NetLoop(proto)) < 0) {
                show_boot_progress (-81);
                return 1;
        }

After that, netboot_update_env is called setting correctly the
variables. So if the transfer stops or is not successful, the dnsip
variable is not updated.

Can you check (it is not the right fix !) if commenting the above return
statement fixes the issue you report ?

> Forcing ARP queries before DNS fixed this (see patch below).

I do not think this is correct.

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