[En-Nut-Discussion] local tcp port randomisation

Harald Kipp harald.kipp at egnite.de
Wed Jul 4 08:53:35 CEST 2012


Hi Ulrich,

On 03.07.2012 23:33, Ulrich Prinz wrote:
 
> port += (uint16_t)NutGetMillis();
> port |= 0xC000;
> 
> That saves some instructions and should be sufficient:
> 1) port must not be initialized as it's value should be random

This would introduce a problem. If the client re-opens a connection within 1ms or 1.6383s, the connection will fail. It is essential to keep port re-use frequency low.


Regards,

Harald



More information about the En-Nut-Discussion mailing list