[ipxe-devel] [gPXE-devel] [PATCH 3/6] [tcp] Randomize TCP bind port
Alessandro Salvatori
sandr8 at gmail.com
Wed Jul 21 21:26:34 UTC 2010
oups, silly me, I should have looked at more context for the patch ;-)
- at -
Here i am, A young man,
A crashing computer program,
Here is a pen, write out my name.
On Wed, Jul 14, 2010 at 02:59, Michael Brown <mbrown at fensystems.co.uk>wrote:
> On Tuesday 13 Jul 2010 20:09:16 Alessandro Salvatori wrote:
> > shouldn't it say "continue" instead of "return 0" if you fail binding
> > the current random port attempt?
>
> The zero return status indicates success; we return if we hit a bind
> success.
>
> > why do we do 65536 attempts? it seems kind of arbitrary to me, given they
> > are all random attempts...
>
> The initial attempt is random; subsequent attempts increment by one. The
> logic is to try up to all of the available 65536 ports (excluding any below
> 1024), but to use a random starting port to minimise the chance of reusing
> the
> same port on consecutive boot attempts.
>
> Michael
> _______________________________________________
> ipxe-devel mailing list
> ipxe-devel at lists.ipxe.org
> https://lists.ipxe.org/mailman/listinfo/ipxe-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ipxe.org/pipermail/ipxe-devel/attachments/20100721/e34b51bb/attachment.htm>
More information about the ipxe-devel
mailing list