public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* TCP LAST-ACK state broken in 2.4.17-pre2
@ 2001-12-10 18:16 Mika Liljeberg
  2001-12-10 18:34 ` kuznet
  0 siblings, 1 reply; 11+ messages in thread
From: Mika Liljeberg @ 2001-12-10 18:16 UTC (permalink / raw)
  To: kuznet, davem; +Cc: linux-kernel

Hi,

I came across the following behavior (sorry, no tcpdump but this should
be easy to reproduce with the right tools):

hostA                 hostB
  --------FIN----------->
  <-----data+FIN---------
  --------ACK-------X       (packet lost)
  <-----data+FIN---------   (retransmit)
  <-----data+FIN---------   (retransmit)
  <-----data+FIN---------   (retransmit)
          ....
  <-----data+FIN---------   (retransmit)
  --------RST----------->

HostA is running Linux 2.4.17-pre2. HostB is running Symbian OS. All the
sequence numbers pan out.

Either LAST-ACK is completely broken or Linux just cannot handle a
FIN-ACK that is piggybacked on a data segment, when received in LAST-ACK
state. It should be acked as an out-of-window segment, as usual.
Finally, the LAST-ACK state times out and Linux responds to the FIN
segment with an RST.

Cheers,

	MikaL

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: TCP LAST-ACK state broken in 2.4.17-pre2
@ 2001-12-13 10:19 Pasi Sarolahti
  0 siblings, 0 replies; 11+ messages in thread
From: Pasi Sarolahti @ 2001-12-13 10:19 UTC (permalink / raw)
  To: linux-kernel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

Mika wrote:
> Looks like there are still problems after applying your quick patch.
> Back at the lab we observed a case where the FIN-ACK packet is dropped
> and Linux fails to retransmit it. See the attached dump for the details
> (Linux is 10.0.5.11). The action ends there, with Linux timing out to
> CLOSED state and the remote stuck in FIN-WAIT-2.

I think following might happen: When the receiver gets FIN and acks it, it
should be in CLOSE_WAIT or LAST_ACK state depending on the situation,
right? In tcp_rcv_state_process() the receiver calls ack_snd_check, which
has the following test:

            if (!tcp_ack_scheduled(tp)) {
		/* We sent a data segment already. */
		return;
	}
	__tcp_ack_snd_check(sk, 1);

I think in this situation it may be possible that ack_scheduled is false,
which would mean that the receiver never acks the further FIN segments if
the first FIN-ack is lost. Maybe something like the following might work,
although it looks pretty ugly :-)

       if (!tcp_ack_scheduled(tp) &&
                                      (sk->state == TCP_ESTABLISHED ||
                                       sk->state == TCP_FIN_WAIT1)) {
                /* We sent a data segment already. */
                return;
        }

(Btw, I'm not on the lkml, so I would like to be cc'd of the further
discussion on this thread)

- - Pasi

- -- 
http://www.cs.helsinki.fi/u/sarolaht/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8GIDRoNa7NH1G2csRAvoLAKC5JbdYF524KMGKOG7X7jObLIkifgCffIbG
tA/Cr4FqSeWhEArt/mPlHGY=
=KD8M
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2001-12-13 19:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-10 18:16 TCP LAST-ACK state broken in 2.4.17-pre2 Mika Liljeberg
2001-12-10 18:34 ` kuznet
2001-12-10 18:54   ` Mika Liljeberg
2001-12-11 17:51     ` kuznet
2001-12-12 20:31       ` Mika Liljeberg
2001-12-13 17:59         ` kuznet
2001-12-13 19:30           ` Mika Liljeberg
2001-12-13 19:38             ` kuznet
2001-12-11  0:13   ` David S. Miller
2001-12-11 17:24     ` kuznet
  -- strict thread matches above, loose matches on Subject: below --
2001-12-13 10:19 Pasi Sarolahti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox