Erik Trauschke wrote:

<snip>

> I can't follow exactly the thing with the introduced skew but the
> limitation of the range of possible numbers is not necessary in my
> opinion, since we only cycle through the number of ports in the range,
> not the ports themselves. Furthermore the number of ports is not limited
> to 64k, there can be ports in the list more than once (e.g. nc -z
> localhost 1-65000,5-65000 [if you want to try that find something else
> to do for the next hours ;-) ]).

I agree that the binary operation is not necessary and it's definitely a 
problem with the scenario highlighted above. For a while I had not been 
able to see how the algorithm can be preferential provided 'hi - low' 
belongs to interval <0,65535> but it's the thing with overlap:

   0            N            N*2    65535 N*3
   |            |            |        |   |
   +------------+------------+--------+---+

Assuming (random() & 0xFFFF) produces values evenly spread over 
<0,65535>, the missing hits to <65536,N*3> lead to the problem (where N 
= hi - low).


v.
_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to