lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Randomized initial local port in tcp_connect()


From: Jan Menzel
Subject: Re: [lwip-users] Randomized initial local port in tcp_connect()
Date: Mon, 7 Aug 2017 11:02:05 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

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
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/lwip-users
> 



reply via email to

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