[gPXE-devel] [PATCH 4/6] [tcp] Waiting for TCP to fully close

Piotr Jaroszyński p.jaroszynski at gmail.com
Tue Jul 13 11:52:09 EDT 2010


On 13 July 2010 17:15,  <cooldavid at cooldavid.org> wrote:
> From: Guo-Fu Tseng <cooldavid at cooldavid.org>
>
> While using scripts, if the downloaded image is not bootable, the gPXE
> exits faster than it have the opportunity to gracefully closing the TCP
> connection. Which might lead the TCP state of remote server not closed.
>
> This commit waits for TCP to fully close by polling remaining ACKs from
> remote server and let the gPXE reply the correct response before
> shutdown the xfer interface.
>
> It is somehow hacky, hoping we can find better solution.

As we talked on irc, how about adding a __shutdown_fn that would clean
up remaining tcp connections? i.e. if there are any not in the
TIME_WAIT state, do a few net_steps and then forcefully close and
clean up (including the ones in TIME_WAIT in the cleanup). I see a
problem with that approach when someone sleeps in a script for longer
periods, but maybe we could change sleep to also do net_step while
sleeping?

-- 
Best Regards
Piotr Jaroszyński


More information about the gPXE-devel mailing list