buglwIP - A Lightweight TCP/IP stack - Bugs: bug #31303, DHCP: when changing static up...

 
 

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

bug #31303: DHCP: when changing static up netif to dhcp link_callback is ignored

Submitter:  Falk Hatzfeld <falk>
Submitted:  Mon 11 Oct 2010 03:08:56 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Invalid
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  None
lwIP version:  CVS Head

Sun 21 Nov 2010 11:48:57 AM UTC, comment #1: 

I think you mixed up the up/down-callback with the link-callback: the up/down-callback notifies the application of the IP status (i.e. valid IP address assigned or not), while the link-callback is mainly used internally to the stack and notifies about changes to the hardware link (i.e. cable pulled/plugged).

As such, triggering the link-callback from dhcp_bind() (when an IP address is assigned) is not intended behaviour. The link-callback is only triggered when your netif driver detects a link change and calls netif_set_link_up/down(). This has to be implemented in your driver. If it's not, the link status is always detected as up.

Simon Goldschmidt <goldsimon>
Group administrator
Mon 11 Oct 2010 03:08:56 PM UTC, original submission:  

I don't know where to fix best but change below fixed it to me.

static void
dhcp_bind(struct netif *netif)
{
[...]
  /* bring the interface up */
  if ( !(netif->flags & NETIF_FLAG_UP ))
    netif_set_up(netif);
  else
    if (netif->link_callback)
        (netif->link_callback)(netif);
  /* netif is now bound to DHCP leased address */
  dhcp_set_state(dhcp, DHCP_BOUND);
}

PS: actually this was on version 1.3.2 which is not selectable at the box

Falk Hatzfeld <falk>

 

(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 falk (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
    2010-11-21 goldsimon Open/ClosedOpen Closed
    2010-11-21 goldsimon StatusNone Invalid
        Assigned toNone goldsimon

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code