From: Andrey Borzenkov <arvidjaar@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Cc: valentin@unimplemented.org, fritsch@genua.de
Subject: Re: [PATCH] Avoid reusing the same TCP port number
Date: Thu, 3 Jul 2014 22:41:25 +0400 [thread overview]
Message-ID: <20140703224125.2e8962fa@opensuse.site> (raw)
In-Reply-To: <B5BAEFB3-84D2-4631-B948-1175E658272A@unimplemented.org>
[-- Attachment #1: Type: text/plain, Size: 1579 bytes --]
В Tue, 1 Jul 2014 13:53:49 +0200
Valentin Dornauer <valentin@unimplemented.org> пишет:
> Hi!
> Attached is another patch from our internal repository. I am not
> certain that it will work under any circumstances and it has only
> been tested on x86 hardware, so please use with care!
>
> We had some very annoying issues with quick consecutive reboots,
> as GRUB would reuse the same TCP port number without properly closing
> the connection (especially when a boot fails). The remote host
> (Apache web server) would then discard the new connection and booting
> from HTTP would fail.
>
>
> I've included excerpts from the original commit message to further
> clarify the problem:
>
> Even if a grub boot succeeds, the TCP connection for the last
> HTTP request stays in state LAST_ACK for some reason. If the
> next reboot happens before the web server discards that connection,
> this will lead to the server not responding to the new SYN on
> the same port number.
>
> Make the initial port number depend on the RTC time. Increase
> it by 80 for every second, wrapping around after 512 seconds.
> The 80 is used because grub opens around 3 connections for every
> file. Use & 511 instead of modulo because of linking problems.
>
> Original patch by Stefan Fritsch <fritsch@genua.de>.
>
> - Valentin
>
May be you can simply use grub_get_time_ms()? After all, we are not
interested in exact time, just in some pseudo-random distribution. It
should have less overhead than grub_get_datetime().
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2014-07-03 18:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-01 11:53 [PATCH] Avoid reusing the same TCP port number Valentin Dornauer
2014-07-03 18:41 ` Andrey Borzenkov [this message]
2015-01-13 14:41 ` Valentin Dornauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140703224125.2e8962fa@opensuse.site \
--to=arvidjaar@gmail.com \
--cc=fritsch@genua.de \
--cc=grub-devel@gnu.org \
--cc=valentin@unimplemented.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.