[En-Nut-Discussion] local tcp port randomisation

Nathan Moore nategoose at gmail.com
Tue Jul 3 17:36:06 CEST 2012


I didn't have any randomization, but was only addressing the relatively
small number of ports available for different methods.






On Tue, Jul 3, 2012 at 10:30 AM, Harald Kipp <harald.kipp at egnite.de> wrote:

> Hi Nathan,
>
> On 03.07.2012 16:13, Nathan Moore wrote:
> > Is there any reason not to just use the negative port numbers (if you
> > interpret them as signed int so top bit = 1) as the ephemeral ports?
> > The range testing is greatly simplified.
>
> Let me resend my code fragment:
>
>  ticks = (uint16_t) NutGetMillis();
>  if (first)
>   port = ticks;
>  else
>   port += ticks & 0x000F;
>  port |= 0xC000;
>
> Where do you think that signed interpretation combined with a increased
> range of 32768 to 65535 could simplify the code above. Note, that the IANA
> range of 49152 to 65535 includes all shorts with two MSBs set.
>
> Regards,
>
> Harald
>
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
>


More information about the En-Nut-Discussion mailing list