[tcp] Use a dedicated timer for the TIME_WAIT state
commit2ad0cd4863f9e5abb520365ed7a4c1111627f8b4
authorMichael Brown <mcb30@ipxe.org>
Thu, 15 Jul 2010 17:57:34 +0000 (15 18:57 +0100)
committerMarty Connor <mdc@etherboot.org>
Sun, 1 Aug 2010 20:10:22 +0000 (1 16:10 -0400)
tree452ef0992109fe8a5fe528b58426448d62aa71ff
parent02e1db51140858113a9a6ffca4c775139b4a470c
[tcp] Use a dedicated timer for the TIME_WAIT state

gPXE currently repurposes the retransmission timer to hold the TCP
connection in the TIME_WAIT state (i.e. waiting for up to 2*MSL in
case we are required to re-ACK our peer's FIN due to a lost ACK).
However, the fact that this timer is running will prevent such an ACK
from ever being sent, since the logic in tcp_xmit() assumes that a
running timer indicates that we ourselves are waiting for an ACK and
so blocks the transmission.  (We always wait for an ACK before sending
our next packet, to keep our transmit data path as simple as
possible.)

Fix by using an entirely separate timer for the TIME_WAIT state, so
that packets can still be sent.

Reported-by: Piotr JaroszyƄski <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Marty Connor <mdc@etherboot.org>
src/net/tcp.c