|
From: | Claudius Zingerli |
Subject: | Re: [lwip-users] DHCP, switch to static IP if no answer |
Date: | Sat, 25 Jun 2011 00:11:06 +0200 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7 |
Bill, On 2011-06-22 16:01 PM, Bill Auerbach wrote:
Walter, I used dhcp_start and then checked in a loop netif_is_up for a connection for 5 seconds. If the 5 seconds ran out, I used dhcp_stop, netif_set_down, netif_set_addr, netif_set_up, and dhcp_inform to set a static IP address.
Just for the protocol: Doing this, you might run into problems if you only wait 5s. RFC2131 (DHCP spec) says:
"4.4.1 [...] The time over which the client collects messages and the mechanism used to select one DHCPOFFER are implementation dependent."
Well, they don't give any numbers, but Windows/Linux/BSD all wait far more than 5s before giving up. Reasons might be ARP checking timeouts at the DHCP server wait longer before sending a DHCPOFFER.
Regards Claudius
[Prev in Thread] | Current Thread | [Next in Thread] |