lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] DHCP not surviving multiple reconnections


From: address@hidden
Subject: Re: [lwip-users] DHCP not surviving multiple reconnections
Date: Wed, 17 Feb 2021 19:40:45 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

Am 16.02.2021 um 15:55 schrieb matt swindell:
> Hello,
>
>  
>
> I am new to LWIP currently I am using LWIP 2.1.2 with no OS (NO_SYS = 1)
> in lwipopts.h.
>
>  
>
> My question is about the connection/disconnection from the DHCP server.
> Using Wireshark I am able to see the initial DHCP request and properly
> receive an IP address, followed by ARP announcements. The device seems
> to survive an initial disconnect, sending a Request to validate it’s IP
> and an ACK from the DHCP server once reconnected. However, further
> disconnects and reconnections appear to confuse the device.
>
>  
>
> I have a PHY interrupt callback which calls netif_set_link_down() and
> netif_set_link_up() when the PHY link status changes. Since the dhcp
> state was bound dhcp_reboot() is called from dhcp_network_changed().
> This all seems to work fine until we hit the dhcp_timeout() and my dhcp
> tries are greater than or equal to REBOOT_TRIES, at which point it calls
> dhcp_discover() and I get stuck in a loop where the device sends a
> discovery message and is offered an IP address back but it gets ignored.
>
>  
>
> By increasing REBOOT_TRIES I am able to get a few more reconnections
> without problem, but at some point it always seems to get stuck in that
> dhcp discovery loop.
>
>  
>
> I am unsure if I have done something incorrectly or if I am confusing
> the DHCP state machine, but from everything I have read with regards to
> LWIP > 2.x.x
>
> calling netif_set_link_up/down() should be sufficient for maintaining
> DHCP once dhcp_start() has been called.
>
>  
>
> Any help would be greatly appreciated.

I'm not aware of a bug here, but I'm not sure. It would probably be best
if you could reproduce this with a unit test?

Regards,
Simon



reply via email to

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