You also need to define LWIP_RAND to a rand()-like function which will
be called to get the next random number. This number is used to initial
the local port. Only if both (LWIP_RAND and
LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS) are defined, UDP (udp.c line 98) and
TCP (tcp.c line 144) use random local ports.
On 07.08.2017 3:19, gussabina wrote:
> I noticed the tcp_connect() function always use the same local (ephemeral)
> port, rather than choosing a random port from a range of available ports.
> This causes problem connecting to the same server as they might think it's
> part of the previous connection if not closed properly.
> I already set the #define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS 1, but I notice
> same behavior.
> Am I missing something?
> View this message in context:
> Sent from the lwip-users mailing list archive at Nabble.com.
> lwip-users mailing list
lwip-users mailing list