On 30.03.2018 10:40, [email protected] wrote:
[..]
Now I'm trying to reconnect the Ethernet cable to another network (different
address area). The device sends a DHCP request which is a broadcast, but the
source is the IP address of the device from the former network and probably
as it is expected, it is not answered. I'm wondering how can I handle this
situation too? Should I use dhcp_stop(), dhcp_start() to be able to handle
all situations by reconnecting instead of dhcp_renew()?

Ehrm, when reconnecting the link, you should now call dhcp_renew() at all. Instead, call dhcp_network_changed(). This function does the correct thing depending on dhcp state. In your situation, it will call dhcp_reboot(), which should try to renew the lease and if that fails request a new one via broadcast.

Simon

_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to