lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] Understanding callback options for link/DHCP status.


From: Luciano Moretti
Subject: [lwip-users] Understanding callback options for link/DHCP status.
Date: Thu, 15 Apr 2021 15:20:19 -0500

Using LwIP 2.1.2 currently:
LwIP provides several optional callbacks and I'm trying to figure out when they're called and what steps I should take when I get one.

Currently, I'm using netif_set_status_callback and it seems like this is called when I receive a new IP address via DHCP. The documentation says that it's called when an "interface is brought up/down" but this doesn't seem to be the case: I don't get a call when I unplug my cable and my cable handling calls netif_set_link_down() like I'd expect. 

I'm also seeing an issue where if I unplug the cable, change DHCP server settings, then replug in the board is briefly pingable at the old DHCP address prior to the new DHCP address being set. When I detect the unplug should I use the netif_set_addr() function to set the values back to the starting defaults of 0.0.0.0 for DHCP?

There appears to be a NETIF_LINK_CALLBACK() and a NETIF_EXT_STATUS_CALLBACK as well, but I can't find good documentation on when those callbacks would be expected if I enable them.

Thank you for any clarification you can provide.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]