Re: 2.1.98: mm++ SYN_SENT--

David S. Miller (davem@dm.cobaltmicro.com)
Mon, 27 Apr 1998 05:37:26 -0700


Date: Mon, 27 Apr 1998 14:07:00 +0200
From: Thomas Quinot <thomas@Cuivre.FR.EU.ORG>

It looks to me like the 3rd packet (from the remote host,
203.103.185.50) should have SYN, and so it is legitimate that we
reset the connection. but then, we should time out in inet_stream
connect if we cannot properly accomplish the TCP handshake.

Thanks for the clean analysis, the bug is clear now. We need to:

In tcp_input.c:tcp_rcv_state_process() first switch() statement, case
TCP_SYN_SENT, in all cases if th->ack set and we fail (and return 1
from this function) for some reason, we must do:

sk->err = ECONNRESET;
sk->state_change(sk);

before returning 1 back (which will send the reset), this will wake up
the person sleeping in inet_stream_connect() and notice the 3 way
handshake failed.

Please test these suggested changes if you have a chance, it should
cure for good the SYN_SENT hangs people have been reporting.

Again, thanks again for the good bug reporting, I wish all were this
easy to fix ;-)

Later,
David S. Miller
davem@dm.cobaltmicro.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu