Hi Gus!
        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.

        Jan

On 07.08.2017 3:19, gussabina wrote:
> Hello:
> 
> 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?
> 
> Thanks
> Gus
> 
> 
> 
> --
> View this message in context: 
> http://lwip.100.n7.nabble.com/Randomized-initial-local-port-in-tcp-connect-tp30384.html
> Sent from the lwip-users mailing list archive at Nabble.com.
> 
> _______________________________________________
> lwip-users mailing list
> lwip-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/lwip-users
> 

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

Reply via email to