[Top][All Lists]

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

Re: [lwip-users] Listening PCBs updating address issue

From: massimiliano cialdi
Subject: Re: [lwip-users] Listening PCBs updating address issue
Date: Tue, 3 May 2022 09:00:19 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1


I have a similar problem (maybe the same?).

Not only with listening TCP sockets but also with already open TCP sockets. When the IP address changes the lwip stack has unexpected behavior. Sometimes no more data arrives, sometimes it arrives but the source address is wrong, sometimes it arrives whether the sender sends to the old or to the new address.

One of the scenarios in which this happens is the following: I have LWIP_DHCP, LWIP_AUTOIP, LWIP_DHCP_AUTOIP_COOP set to 1. My application starts but there is no DHCP server in the network, so it assigns itself an autoip address (169.254.x.x). Afterwards a DHCP server is connected to the network, and my application will receive a new address when it queries it. From that point on the lwip stack seems to "break".

I use lwip STABLE-2_1_3_RELEASE (commit 6ca936f6b588cee702c638eee75c2436e6cf75de)

best regards


On 29/04/22 15:18, Amena El Homsi wrote:

When we call netif_remove(), tcp_netif_ip_addr_changed() is called. In this case old_addr is not null and new_addr is null, which means that tcp_netif_ip_addr_changed_pcblist() will be called to abort active and bound pcbs. 
However, since new_addr is null, the listening pcbs are not updated and they are still listening to the old addr.
When we start a new DHCP session and we get an IP address, tcp_netif_ip_addr_changed() is called. However, since old_addr is NULL, the listening PCBs will not be updated.

We should have a way to update the listening PCBs ip address even when the old_addr is null. Am I right or wrong?


Amena El-Homsi
Computer & Communication Engineer
Dipl. Eng,  M.S.

lwip-users mailing list

Massimiliano Cialdi

Powersoft S.p.A.
Via E. Conti, 5 - Scandicci (Fi) 50018 - Italy
OFFICE:    +39 055 7350230


reply via email to

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