[bug #54574] Comment to LWIP_DHCP_CHECK_LINK_UP might need improvement

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[bug #54574] Comment to LWIP_DHCP_CHECK_LINK_UP might need improvement

Simon Goldschmidt
URL:
  <http://savannah.nongnu.org/bugs/?54574>

                 Summary: Comment to LWIP_DHCP_CHECK_LINK_UP might need
improvement
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: ole_c
            Submitted on: Sun 26 Aug 2018 05:15:21 PM UTC
                Category: Documentation
                Severity: 3 - Normal
              Item Group: Feature Request
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
            lwIP version: git head

    _______________________________________________________

Details:

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





    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?54574>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #54574] Comment to LWIP_DHCP_CHECK_LINK_UP might need improvement

Simon Goldschmidt
Follow-up Comment #1, bug #54574 (project lwip):

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.

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?54574>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #54574] Comment to LWIP_DHCP_CHECK_LINK_UP might need improvement

Simon Goldschmidt
Follow-up Comment #2, bug #54574 (project lwip):

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


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?54574>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #54574] Comment to LWIP_DHCP_CHECK_LINK_UP might need improvement

Simon Goldschmidt
Follow-up Comment #3, bug #54574 (project lwip):

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

Yes.

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?54574>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #54574] Comment to LWIP_DHCP_CHECK_LINK_UP might need improvement

Simon Goldschmidt
Update of bug #54574 (project lwip):

                  Status:                    None => Fixed                  
             Assigned to:                    None => goldsimon              
             Open/Closed:                    Open => Closed                

    _______________________________________________________

Follow-up Comment #4:

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

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?54574>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel