2020-05-22 03:03 PM
Hi,
Why it is required (or recommended, as I see in examples) to set the link down when the cable is plugged out from the ethernet connector? It works when I once set the link up and leave it up forever. It doesn't matter when I plug out and in the cable, it continues to work afterwards without any problem.
Solved! Go to Solution.
2020-05-22 07:44 PM
> It doesn't matter when I plug out and in the cable
Link up/down handling is optional.
Change of peer or network may be important.
Restarting DHCP client or server?
IPv6 discover?
Re-subscribing or re-advertising services?
See also https://lwip.fandom.com/wiki/DHCP.
2020-05-22 07:44 PM
> It doesn't matter when I plug out and in the cable
Link up/down handling is optional.
Change of peer or network may be important.
Restarting DHCP client or server?
IPv6 discover?
Re-subscribing or re-advertising services?
See also https://lwip.fandom.com/wiki/DHCP.
2020-05-30 03:56 AM
You are a developer and you have the source code. Look at it!
http://git.savannah.nongnu.org/cgit/lwip.git/tree/src/core/netif.c#n1013
You don't even have to understand it deeply. The function names already answer your question pretty clearly!
2020-05-30 06:41 AM
I looked but it didn't helped. I was qurious WHY this callback exists, but the first answer was helpful like re-starting DHCP. (in case if I plug in another cable not the one that I plugged out.)
2020-05-30 10:48 AM
Yes, discovery is one reason. Also, as you can see from function names, AutoIP needs it. And in real projects one will often want to report link status to application code for LED/GUI indication and/or logging purposes. :)