buglwIP - A Lightweight TCP/IP stack - Bugs: bug #41787, DHCP Discovery is invalid when an...

 
 

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

bug #41787: DHCP Discovery is invalid when an IP is set to thet netif.

Submitted by:  Nick van IJzendoorn <dipswitch_>
Submitted on:  Thu 06 Mar 2014 08:40:21 AM 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

Sun 06 Apr 2014 06:33:48 PM UTC, comment #3:

Fixed by sending discover, request and decline from 'any' even if netif has an address asigned.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Fri 04 Apr 2014 08:02:26 PM UTC, comment #2:

In section 4.1, it says:
"DHCP messages broadcast by a client prior to that client obtaining
its IP address must have the source address field in the IP header
set to 0."

But I guess you can argue whether that fits to our case, because we already obtained an IP address through AutoIP or user configuration...

Anyway, I'd think it would be better to have 0.0.0.0 as the source address for DHCP broadcasts.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Fri 04 Apr 2014 07:59:45 PM UTC, comment #1:

The DISCOVER packet does not seem invalid to me: the 'ciaddr' field is zero. Only the source address of the IP packet is != 0.0.0.0, I haven't found yet whether that's valid or not...

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Thu 06 Mar 2014 08:40:21 AM UTC, original submission:

The DHCP client will send an invalid DHCP Discovery packet (according to RFC2131 the ciaddr MUST be zero in the DISCOVERY phase) when the IP of the netif is already set. For instance when you are switching from static IP to dynamic IP.

I know you could clear the IP, subnet and gateway yourself before starting the DHCP client. But I personally think it would be cleaner / better if LwIP clears the IP, subnet and gateway before turning on the DHCP client.

One solution could be to patch the DHCP client like the patch provided.

Nick van IJzendoorn <dipswitch_>

 

Attached Files
file #30790:  dhcp.patch added by dipswitch_ (2KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by goldsimon (Posted a comment)
  • -unavailable- added by dipswitch_ (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 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 06 Apr 2014 06:33:48 PM UTCgoldsimonCategoryNone=>DHCP
      Item GroupNone=>Faulty Behaviour
      StatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed
    Thu 06 Mar 2014 08:40:33 AM UTCdipswitch_Attached File-=>Added dhcp.patch, #30790

    Back to the top


    Powered by Savane 3.1-cleanup1