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

Submitted by:  Christoffer Lind <christofferlind>
Submitted on:  Wed 30 Jan 2013 03:43:21 PM UTC  
 
Category: DHCPSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned 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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>

 

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 10 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 23 Mar 2016 08:10:28 PM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed
    Fri 18 Mar 2016 06:41:35 PM UTCfmatignonAttached File-=>Added dhcp-options-are-not-recorded-in-all-dhcp-ack-messages.patch, #36689
    Mon 31 Aug 2015 06:35:33 PM UTCgoldsimonAssigned togoldsimon=>None
    Tue 23 Jun 2015 07:21:52 AM UTCgoldsimonStatusFixed=>None
      Open/ClosedClosed=>Open
    Fri 20 Mar 2015 07:33:24 PM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1