buglwIP - A Lightweight TCP/IP stack - Bugs: bug #50755, DHCP Not Binding


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

bug #50755: DHCP Not Binding

Submitted by:  Peter Stedman <pstedman>
Submitted on:  Fri 07 Apr 2017 07:10:03 PM UTC  
Category:  DHCP Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Works For Me
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Planned Release:  None
lwIP version:  2.0.2

( Jump to the original submission)

Tue 11 Apr 2017 08:07:28 PM UTC, comment #9: 

Thanks for the feedback.
Regarding debug printing: feel free to ask on the lwip-users about it for help! That's a better place than here ;-)

Simon Goldschmidt <goldsimon>
Project Administrator
Tue 11 Apr 2017 07:15:37 PM UTC, comment #8: 

Hi Simon, I haven't been able to get the debug printing working so please close this. Thanks

Peter Stedman <pstedman>
Tue 11 Apr 2017 07:00:52 PM UTC, comment #7: 

Any input on this or can I close it as invalid?

Simon Goldschmidt <goldsimon>
Project Administrator
Fri 07 Apr 2017 08:10:30 PM UTC, comment #6: 

Hi Ambroz,

OK I'll turn on the debug and see what it says.


Peter Stedman <pstedman>
Fri 07 Apr 2017 07:58:58 PM UTC, comment #5: 

Sorry I meant the Discovery, Offer, Request and Acknowledge phases of the DHCP process.

Maybe something is wrong with my dhcp_timeout(). This happens after my device has disconnected from the internet for some reason. It then continually restarts the connection process which starts with the DHCP bind (DHCP->DNS->TCP) until it connects back to our server.

Somewhere in that process the DHCP client is getting broken.

Peter Stedman <pstedman>
Fri 07 Apr 2017 07:55:36 PM UTC, comment #4: 

I assume he means Discover/Offer/Request/Ack - the basic bootstrap without ARP probably will succeed in spite of nonfunctional DHCP timer.

@Peter, you could enable trace output from lwIP/DHCP (I think this is done by #define DHCP_DEBUG LWIP_DBG_ON and making sure your LWIP_PLATFORM_DIAG works). With these messages it will be possible to see what is happening in DHCP with the timers.

Ambroz Bizjak <abizjak>
Fri 07 Apr 2017 07:45:37 PM UTC, comment #3: 

What's DORA? dhcp_timeout() binds if DHCP is in state DHCP_STATE_CHECKING for the 2nd time...

Simon Goldschmidt <goldsimon>
Project Administrator
Fri 07 Apr 2017 07:40:35 PM UTC, comment #2: 

Hi Simon,

Thanks for getting back.

So how does lwIP get all the way through DORA and stop at the ARP check? I never stop calling sys_check_timeouts() in my main loop.


Peter Stedman <pstedman>
Fri 07 Apr 2017 07:20:16 PM UTC, comment #1: 

That pretty much doesn't sound like a bug but a missing call to the dhcp timers. And without the timers working, lwIP won't really work in general...

Simon Goldschmidt <goldsimon>
Project Administrator
Fri 07 Apr 2017 07:10:03 PM UTC, original submission:  


I have been having trouble binding with the DHCP server from our device sometimes. This happens after disconnection from the router router due to cable removed, router looses power, etc.

After debugging I saw that the DHCP client had received the ACK from the DHCP server after the offered address request. The stack had DHCP_DOES_ARP_CHECK enabled so it then sent a message but never finished the process even when a reply never came.

So I disabled DHCP_DOES_ARP_CHECK and the DHCP binding worked normally.

Is this a known problem and do I really need DHCP_DOES_ARP_CHECK anyway?


Peter Stedman <pstedman>


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by abizjak (Posted a comment)
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by pstedman (Submitted the item)

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

    Only logged-in users can vote.




    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-04-11 goldsimon Open/ClosedOpen => Closed
    2017-04-07 goldsimon StatusNone => Works For Me

    Back to the top

    Powered by Savane 3.5