All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jerry Van Baren <gerald.vanbaren@ge.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] PATCH for U-Boot 1.3.3 DHCP fails with netgear WGR614v6
Date: Mon, 14 Jul 2008 08:29:28 -0400	[thread overview]
Message-ID: <487B46A8.7040106@ge.com> (raw)
In-Reply-To: <200807111720.57618.rgetz@blackfin.uclinux.org>

Foreword:  As Wolfgang noted, Robin's emails apparently are being 
discarded by Sourceforge.  I'm dual-subscribed - home and work - and 
only received emails from Robin on the email that was directly addressed 
to me.

Robin Getz wrote:
> On Fri 11 Jul 2008 14:52, Jerry Van Baren pondered:
>> Ben Warren wrote:
>>> Robin Getz wrote:
>>>> I was trying out U-Boot 1.1.3 with a new(er) router netgear WGR614v6 - 
>>>> firmware version V2.0.19_1.0.19NA, on a Blackfin BF537-STAMP.
>>>>
>>>> http://kbserver.netgear.com/products/wgr614v6.asp
>>>>
>>>> and found that dhcp fails :( 
>>>> bfin> dhcp
>>>> BOOTP broadcast 1
>>>> BOOTP broadcast 2
>>>> BOOTP broadcast 3
>>>> BOOTP broadcast 4
>>>> BOOTP broadcast 5
>>>>
>>>> Retry count exceeded; starting again
>>>>
>>>> When turning on some more verbose debug messages (in the net driver & in 
> the 
>>>> network code, not all of which exists in U-Boot release or trunk), we can 
> see 
>>>> exactly what is going on...
>>>>
>>>> =============================
>> First DHCP request...
>>
>>>> bfin> dhcp
>>>> Eth_halt: ......
>>>> Eth_init: ......
>>>> BOOTP broadcast 1
>>>> setting transaction ID to 3268fe22
>>>> BFIN EMAC send: length = 343
>>>> BFIN EMAC rx: length = 552
>>>> packet received
>>>> packet received
>>>> Receive from protocol 0x800
>>>> Got IP
>>>> len=308, v=45
>>>> passing packet len= 280
>>>> DHCPHandler: got packet: (src=67, dst=68, len=280) state: 3
>>>> Filtering pkt = 0
>>>> DHCPHandler: got DHCP packet: (src=67, dst=68, len=280) state: 3
>>>> DHCP: state=SELECTING bp_file: ""
>>>> TRANSITIONING TO REQUESTING STATE
>>>> IP was: 0.0.0.0
>>>> IP now: 192.168.0.9
>> ...worked.
> 
> No - the DCHP server offered an address, When U-Boot does a DHCPREQUEST 
> (confirming it can have that address) it gets a DHCP NAK.

Right.  My confusion.

>>>> Bootfile:
>>>> DhcpSendRequestPkt: Sending DHCPREQUEST
>> Why is the second DHCP request being sent? 
> 
> This is not a 2nd DHCP request being sent. This is part of the DHCP protocol.

Right.  My confusion.

>> What is the second DHCP  
>> request asking for (sniff the net with wireshark). 
> 
> I can send you the wireshark file, but it is exactly as I described.
> 
> http://www.ietf.org/rfc/rfc1533.txt
> 
> Client sends DHCPDISCOVER
> server sends DHCPOFFER
> Client sends DHCPREQUEST
> Server sends ARP
> Client responds to ARP before it should
> Server sends DHCPNAK, because someone on the network is using the IP number 
> (and doesn't bother to check the MAC - and notice that is the machine that it 
> just gave the IP number to).
> Clients tosses the offer info (it did get NAKed), and starts over.

RFC-1533 is "DHCP Options and BOOTP Vendor Extensions".  RFC-2131 
"Dynamic Host Configuration Protocol" appears to be the right RFC.

The above sequence is somewhat odd and I would contend that it should be 
classified as a DHCP server bug.  Quoting from RFC-2131:

-------------------------------------------------------------------------
2.2 Dynamic allocation of network addresses

[snip]

As a consistency check, the allocating server SHOULD probe the reused 
address *before* allocating the address, e.g., with an ICMP echo 
request, and the client SHOULD probe the newly received address, e.g., 
with ARP.
-------------------------------------------------------------------------

My emphasis on the word *before*.  The Netgear is apparently probing 
*after* allocating the IP address and then *withdrawing* it's allocation 
when u-boot (improperly) responds to the ARP (the ARP is probably is a 
side effect of a ICMP probe).  This would explain why we have not been 
bitten by this bug before.

Of course u-boot needs to abide by Postel's Prescription: "Be liberal in 
what you accept, and conservative in what you send."
   <http://www.postel.org/postel.html>

IMHO, the Netgear WGR614v6 bug triggered a u-boot bug, for which we have 
a proposed/accepted (applied?) bug fix.

[snip]

Best regards,
gvb

  parent reply	other threads:[~2008-07-14 12:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200807111217.03285.rgetz@blackfin.uclinux.org>
2008-07-11 18:21 ` [U-Boot-Users] PATCH for U-Boot 1.3.3 DHCP fails with netgear WGR614v6 Ben Warren
2008-07-11 18:52   ` Jerry Van Baren
2008-07-11 19:01     ` Jerry Van Baren
2008-07-11 19:05     ` Ben Warren
2008-07-11 19:15       ` Jerry Van Baren
2008-07-11 19:31         ` Ben Warren
2008-07-11 19:51           ` Jerry Van Baren
     [not found]     ` <200807111720.57618.rgetz@blackfin.uclinux.org>
2008-07-14 12:29       ` Jerry Van Baren [this message]
     [not found]   ` <200807111712.51366.rgetz@blackfin.uclinux.org>
2008-07-11 22:05     ` [U-Boot-Users] PATCH for U-Boot 1.3.3 DHCP fails with netgearWGR614v6 Ben Warren
     [not found]       ` <200807111835.35597.rgetz@blackfin.uclinux.org>
2008-07-11 22:41         ` [U-Boot-Users] PATCH for U-Boot 1.3.3 DHCP fails withnetgearWGR614v6 Ben Warren
2008-07-11 22:54           ` Wolfgang Denk
2008-07-11 23:12             ` Ben Warren
2008-07-12 14:17               ` Wolfgang Denk
     [not found]           ` <200807111905.35936.rgetz@blackfin.uclinux.org>
2008-07-14 22:42             ` Ben Warren
2008-07-15 19:47               ` Wolfgang Denk

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=487B46A8.7040106@ge.com \
    --to=gerald.vanbaren@ge.com \
    --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 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.