lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] DHCP and Ethernet disconnection


From: Vinu Gopalakrishnan
Subject: Re: [lwip-users] DHCP and Ethernet disconnection
Date: Tue, 10 Dec 2019 16:13:33 +0530

Hi  Giuseppe,

You have to enable your  PHY interrupt and on interrupt , read the PHY registers and verify that the physical link is down. Then intimate the stack that link has gone down using the  netif_set_link_down. Then can dhcp_network_changed().

regards, 
Vinu Gopalakrishnan
Sr. Software Engineer
Gadgeon Smart Systems
m:+91-9526481318

 www.linkedin.com/in/vinu-gopalakrishnan


On Tue, Dec 10, 2019 at 4:07 PM Sylvain Rochet <address@hidden> wrote:
Hi Giuseppe,

On Tue, Dec 10, 2019 at 11:18:12AM +0100, Giuseppe Modugno wrote:
> I designed a network adapter board with Ethernet interface and lwip TCP/IP
> stack, with DHCP client enabled. It works well.
>
> What happens if I disconnect the Ethernet cable from one network and connect
> it to a second network where is a different DHCP server? Mainly if the first
> network works on different address range (for example, 192.168.1.x and
> 192.168.2.x with 255.255.255.0 netmask).
>
> I tried and it appears lwip/DHCP client doesn't trigger a new DHCP request
> and continue working with the first IP address... so it doesn't work on the
> second network.

It does, but you will have to tell lwIP that network changed if you
don't want to wait for the next lease update.

See netif_set_link_down() / netif_set_link_up() to retrigger DHCP start.

Sylvain
_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users

reply via email to

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