buglwIP - A Lightweight TCP/IP stack - Bugs: bug #38203, DHCP options are not recorded in...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #38203: DHCP options are not recorded in all DHCP ack messages

Submitter:  Christoffer Lind <christofferlind>
Submitted:  Wed 30 Jan 2013 03:43:21 PM UTC
   
 
Category:  DHCP Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  None
lwIP version:  1.4.0

Wed 23 Mar 2016 08:10:28 PM UTC, comment #5: 

Of course you're right about the RFC! Fixed, thanks for the patch.

Simon Goldschmidt <goldsimon>
Group administrator
Fri 18 Mar 2016 06:41:35 PM UTC, comment #4: 

Hello,

I had to fix this bug because it did affect my application.

I think the issue described on the user's list about REBOOTING state may also occur in RENEWING or REBINDING since lwip does not send the parameters list in all those cases.

I've been digging RFC 2131 and it states "If the client included a list of requested parameters in a DHCPDISCOVER message, it MUST include that list in all subsequent messages." (section 4.3.2 "DHCPREQUEST message" and section 4.4.1 "Initialisation and allocation of network address").
From my understanding, DHCPREQUEST messages sent from SELECTING, RENEWING, REBINDING and INIT-REBOOT states should include the parameter list, even if this is not explicitely written in the RFC.
Even if not explicitely required, doing so is allowed and should force every DHCP server to send the parameters in the following ACK.

I attach the patch I used to fix this bug, which consists in Simon's original fix plus sending requested parameters list in dhcp_renew(), dhcp_rebind() and dhcp_reboot().

(file #36689)

Florent Matignon <fmatignon>
Tue 23 Jun 2015 07:21:52 AM UTC, comment #3: 

Hmmm... This is not a problem on our DHCP servers since they seem to send everything needed. Nevertheless, I don't want to leave it as is and don't really have the time right now to investigate this further...

-> I've reverted the fix and reopened this bug.

Simon Goldschmidt <goldsimon>
Group administrator
Mon 22 Jun 2015 02:13:46 PM UTC, comment #2: 

As commented by a user (in the user's list), this patch causes unwanted behavior (As I understand the RFC, this looks so) in REBOOTING.
In short: 1.4.1 was doing OK and HEAD is causing address loss on unplug/plug
In detail: the client already has a lease and due to its interface changing state it asks the server just in case it has been plugged elsewhere, so it does not send all initial options (it is not required, is it ?). The introduced call to dhcp_handle_ack() causes the client to parse the almost empty ACK and erases its valid and remembered IP address and mask.

Sergio R. Caprile <scaprile>
Fri 20 Mar 2015 07:33:24 PM UTC, comment #1: 

Reading the RFC, I think you're right about the options in ACKs - I've just fixed that, thanks for reporting.

However, although it seems clear an ACK in REBINDING comes from a different server (or else it would have been received in RENEWING), the RFC does not speak of saving the server identifier from an ACK, it only says to save it from an OFFER, which is what we do.

The result is (possibly intended by the RFC?), that once bound, a client always first RENEWs to the original server instead of changing servers.

As it seems unclear to me, I'd rather not change it without knowing more.

Simon Goldschmidt <goldsimon>
Group administrator
Wed 30 Jan 2013 03:43:21 PM UTC, original submission:  

The code in dhcp_recv() only calls the function dhcp_handle_ack() if the current state is DHCP_REQUESTING. According to RFC 2131 "4.4 DHCP client behavior" the client shall record the lease time in state DHCP_REBOOTING, DHCP_REBINDING and DHCP_RENEWING as well. As far as I understand from the RFC this applies to all options (not only the lease time) and the options shall be updated in all 4 states.

Another thing I noticed was that the server_ip_addr is only updated in dhcp_handle_offer. This should also be updated in dhcp_handle_ack.



Christoffer Lind <christofferlind>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by fmatignon (Updated the item)
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by christofferlind (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-03-23 goldsimon StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
    2016-03-18 fmatignon Attached File- Added dhcp-options-are-not-recorded-in-all-dhcp-ack-messages.patch, #36689
    2015-08-31 goldsimon Assigned togoldsimon None
    2015-06-23 goldsimon StatusFixed None
        Open/ClosedClosed Open
    2015-03-20 goldsimon StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.12