[En-Nut-Discussion] local tcp port randomisation

Ole Reinhardt ole.reinhardt at embedded-it.de
Fri Jul 6 14:10:09 CEST 2012


Hi All,

wow, thread I've kicked off a long thread while I was out of office in
the meantime....

> I know that you suggested to keep the variable uninitialized. But this
> is not standard C. It's highly compiler/linker dependent. Anyway, it
> inspired me to change my suggested code again:
> 
>  ticks = (uint16_t) NutGetMillis();
>  if (port)
>    port += (uint16_t) ((ticks & 0x000F) | 1);
>  else
>    port = ticks;
>  port |= 0xC000;

I would be fine with this for the first instance as long as we do not
have a real random number.

Am I right, that we could all agree, to take this as an intermediate
solution?

Thanks for all your comments and suggestions!

bye,

Ole


-- 

Thermotemp GmbH, Embedded-IT

Embedded Hard-/ Software and Open Source Development, 
Integration and Consulting

http://www.embedded-it.de

Geschäftsstelle Siegen - Steinstraße 67 - D-57072 Siegen - 
tel +49 (0)271 5513597, +49 (0)271-73681 - fax +49 (0)271 736 97

Hauptsitz - Hademarscher Weg 7 - 13503 Berlin
Tel +49 (0)30 4315205 - Fax +49 (0)30 43665002
Geschäftsführer: Jörg Friedrichs, Ole Reinhardt
Handelsregister Berlin Charlottenburg HRB 45978 UstID DE 156329280 




More information about the En-Nut-Discussion mailing list