link down handling in dhcp v1.4.1

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

link down handling in dhcp v1.4.1

vinu
Hi all,

I have come across an issue related to DHCP and link status.

The device does not restart the dhcp negotiation whenever the link goes down
and up automatically. Note that I have an interrupt callback for PHY link
up/down.

How should the dhcp be handled when the link up/down event occurs? I have
seen many posts regarding the same, but i just wanted to make sure that we
are doing this in the correct way. Please help.

I just read that dhcp_network_changed() shall be used in case the lease time
has not expired and dhcp_start shall be used if the dhcp server
changes/reboots. Please correct me if i am wrong.

regards,
Vinu



--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: link down handling in dhcp v1.4.1

goldsimon@gmx.de
Am 06.11.2019 um 15:16 schrieb vinu:

> Hi all,
>
> I have come across an issue related to DHCP and link status.
>
> The device does not restart the dhcp negotiation whenever the link goes down
> and up automatically. Note that I have an interrupt callback for PHY link
> up/down.
>
> How should the dhcp be handled when the link up/down event occurs? I have
> seen many posts regarding the same, but i just wanted to make sure that we
> are doing this in the correct way. Please help.

Make sure you get from the PHY interrupt into tcpip_thread and call
dhcp_network_changed() from there. That should be all.

Regards,
Simon

>
> I just read that dhcp_network_changed() shall be used in case the lease time
> has not expired and dhcp_start shall be used if the dhcp server
> changes/reboots. Please correct me if i am wrong.
>
> regards,
> Vinu
>
>
>
> --
> Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html
>
> _______________________________________________
> lwip-users mailing list
> [hidden email]
> https://lists.nongnu.org/mailman/listinfo/lwip-users
>


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: link down handling in dhcp v1.4.1

vinu
Hi Simon,

Is it safe to call dhcp_network_changed() from application thread ? I tried
it ans seems to be working properly. Also, should i call netif_set_down()
and netif_set_addr() before dhcp_network_changed() ?

regards,
Vinu



--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: link down handling in dhcp v1.4.1

goldsimon@gmx.de


Am 7. November 2019 08:59:54 MEZ schrieb vinu <[hidden email]>:
>Hi Simon,
>
>Is it safe to call dhcp_network_changed() from application thread ? I
>tried
>it ans seems to be working properly.

No, it's not safe. Don't do that.

> Also, should i call
>netif_set_down()
>and netif_set_addr() before dhcp_network_changed() ?

No.

Regards,
Simon

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: link down handling in dhcp v1.4.1

vinu
After going through some related posts, i understand that its better to use
netifapi_netif_common(n, NULL, dhcp_start) instead of dhcp_start( ) as its
protects the lwip core from concurrent access.

Hope that enabling LWIP_TCPIP_CORE_LOCKING feature is fine -
As i saw the lines..... (EXPERIMENTAL!) Don't use it if you're not an active
lwIP project member ?

Vinu




--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html

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