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

Submitted by:  Falk Hatzfeld <falk>
Submitted on:  Mon 11 Oct 2010 03:08:56 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Invalid
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned 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>
Project AdministratorIn charge of this item.
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>

 

No files currently attached

 

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 falk (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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 21 Nov 2010 01:28:58 PM UTCgoldsimonOpen/ClosedOpen=>Closed
    Sun 21 Nov 2010 11:48:57 AM UTCgoldsimonStatusNone=>Invalid
      Assigned toNone=>goldsimon

    Back to the top


    Powered by Savane 3.1-cleanup1