[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Avoid reusing the same TCP port number
From: |
Valentin Dornauer |
Subject: |
[PATCH] Avoid reusing the same TCP port number |
Date: |
Tue, 1 Jul 2014 13:53:49 +0200 |
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 <address@hidden>.
- Valentin
0001-Avoid-reusing-the-same-TCP-port-number.patch
Description: Binary data
signature.asc
Description: Message signed with OpenPGP using GPGMail
- [PATCH] Avoid reusing the same TCP port number,
Valentin Dornauer <=