patchlwIP - A Lightweight TCP/IP stack - Patches: patch #8560, DHCP is not notified of link down...

 
 

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

patch #8560: DHCP is not notified of link down events, admin status remains "up"

Submitter:  Vlad Lungu <vlungu>
Submitted:  Wed 29 Oct 2014 01:34:02 PM UTC
   
 
Category:  DHCP Priority:  5 - Normal
Status:  Wont Do Privacy:  Public
Assigned to:  goldsimon Open/Closed:  Closed
Planned Release:  None

Thu 30 Oct 2014 09:26:20 PM UTC, comment #4: 

Oh. I see. This kind of makes sense.

I guess you can close this then.

Vlad Lungu <vlungu>
Thu 30 Oct 2014 09:14:22 PM UTC, comment #3: 

Oh, don't bother the comment. If it's wrong, it can be easily changed :-)

The way I see it, what you want is to set the 'admin' status down when the link is dropped and DHCP is active.

What I still don't know is why you need it.

As a side remark: I'm not at all happy with DHCP setting the admin state to down. I'd rather make it set the interface address to zero and then let other parts of lwIP check for a valid address configuration before sending instead of only checking the 'up' flag. This would allow to make the 'up' flag a real 'admin' status (i.e. dhcp_start on a disabled netif wouldn't enable it). That's the reason I don't want to go into the 'wrong' direction with this patch and set the 'admin' state to disabled while the cable is unplugged.

Simon Goldschmidt <goldsimon>
Group administrator
Thu 30 Oct 2014 09:04:27 PM UTC, comment #2: 

From dhcp.c:
"Handle a possible change in the network configuration.
This enters the REBOOTING state to verify that the currently bound address is still valid."

Link going down is a change in network configuration.

Also, this does not make admin and operational status the same. You can have operational status 'up', but admin status will be 'down' until a REQUEST message is ACK-ed (we enter DHCP_BOUND state).

Since the admin status goes 'down' anyway when operational status goes 'up' (until the client eventually re-binds the address), we might as well do it early. If this is not the way to do it, I'm open to suggestions (maybe check link status before calling dhcp_reboot() ?).

Vlad Lungu <vlungu>
Thu 30 Oct 2014 08:00:33 PM UTC, comment #1: 

The proposed fix is definitively wrong, as it starts dhcp-discover. The function dhcp_network_changed is meant to be called when the link is reestablished (as it is in netif_set_link_up).

Anyway, what you proposed would make the 'admin' status equal to the 'link' status, which doesn't make much sense to me.

What do you need this change for?

Simon Goldschmidt <goldsimon>
Group administrator
Wed 29 Oct 2014 01:34:02 PM UTC, original submission:  


Vlad Lungu <vlungu>

 

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

Attached Files

 

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 vlungu (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-10-31 goldsimon Open/ClosedOpen Closed
    2014-10-30 goldsimon StatusNone Wont Do
        Assigned toNone goldsimon
    2014-10-29 vlungu Attached File- Added 0001-Fix-DHCP-handling-of-link-state.patch, #32338

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code