buglwIP - A Lightweight TCP/IP stack - Bugs: bug #54574, Comment to LWIP_DHCP_CHECK_LINK_UP...

 
 

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

bug #54574: Comment to LWIP_DHCP_CHECK_LINK_UP might need improvement

Submitter:  Ole Christensen <ole_c>
Submitted:  Sun 26 Aug 2018 05:15:21 PM UTC
   
 
Category:  Documentation Severity:  3 - Normal
Item Group:  Feature Request Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  None
lwIP version:  git head

Fri 07 Sep 2018 07:02:06 PM UTC, comment #4: 

Fixed by removing that define (and making the code behave as if it was set to 1). Thanks for reporting.

Simon Goldschmidt <goldsimon>
Group administrator
Wed 05 Sep 2018 08:40:18 AM UTC, comment #3: 


> in case the option is dropped, the behavior should be the same as with LWIP_DHCP_CHECK_LINK_UP==1


Yes.

Simon Goldschmidt <goldsimon>
Group administrator
Wed 05 Sep 2018 08:39:10 AM UTC, comment #2: 

Well basically I cannot assess what you are saying. The thing I see is, in case the option is dropped, the behavior should be the same as with LWIP_DHCP_CHECK_LINK_UP==1.

Thanks, Ole

Ole Christensen <ole_c>
Tue 04 Sep 2018 08:19:03 PM UTC, comment #1: 

Hmm, I don't think this option is needed at all: while dhcp works without the NETIF_FLAG_LINK_UP flag (because udp_sendto_if() is used), ip_route() requires netifs to have a link.

So this seems like an old outdated config option: netifs not supporting link state change must set the link as up in their init function.

Simon Goldschmidt <goldsimon>
Group administrator
Sun 26 Aug 2018 05:15:21 PM UTC, original submission:  

The comment to the configuration option LWIP_DHCP_CHECK_LINK_UP in opt.h currently says:

"LWIP_DHCP_CHECK_LINK_UP==1: dhcp_start() only really starts if the netif has NETIF_FLAG_LINK_UP set in its flags. As this is only an optimization and netif drivers might not set this flag, the default is off. If enabled, netif_set_link_up() must be called to continue dhcp starting."

My network driver actually does support netif_set_link_up() and if LWIP_DHCP_CHECK_LINK_UP is set to 0, the DHCP discovery is done twice without waiting for the 1st response. Unfortunately this seems to confuse a router (Fritzbox) I am currently behind. Its DHCP server always returns a different IP if LWIP_DHCP_CHECK_LINK_UP is 0. If set to 1, the box returns the same IP on each discovery as expected.

One might say, this is an issue of the router. True, but I think the client should in any case wait for a response before issuing another discovery.

For my feeling, it is good enough to improve the comment to the configuration option. Something like:

If the netif driver does support NETIF_FLAG_LINK_UP, this option should be enabled to prevent the DHCP client from issuing a DHCP discovery without waiting for a response. The latter might confuse poorly designed DHCP servers.

Cheers, Ole

Ole Christensen <ole_c>

 

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

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 goldsimon (Posted a comment)
  • -email is unavailable- added by ole_c (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-09-07 goldsimon StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code