Re: RSH problem is back

NIIBE Yutaka (gniibe@mri.co.jp)
Mon, 11 Nov 1996 10:37:54 +0900


Hi Linus,

Linus Torvalds writes:
> Why is this ACK sent twice? The second ACK looks like the problem, and the
> reason for it _seems_ to be that we opened our window. But we shouldn't have
> sent the ACK at all, as we've already acked the FIN packet from the other end
> and we've closed it ourselves.
>
> That's why the other end ends up sending us a RTS, because we send an
> extra ACK that we never should have sent. So I think that the correct
> fix is not to make tcp_rcv() do anything special for this case, but to
> make sure the second ACK is never sent in the first place.
>
> I think it's cleanup_rbuf() in net/ipv4/tcp.c that does the extra ack: it
> should probably check to make sure that we don't send an ACK even if our
> window changed if the socket is dead..

Indeed. However, even this ACK problem will be fixed, I think my fix
for RST problem should be applied, because there is a case where ACK
comes twise.

Here is the situation.
================
send FIN
-----
-----
-----> got FIN
timeout
send FIN again
----- send ACK
-----======
=====-----> got FIN
got ACK <=====
set sk->state send ACK
= TCP_CLOSE ======
=====
<=====

Should discard this ACK
Don't send RST for this ACK
================

I think until the timer expired and destroy_sock() is called, the
socket should handle ACK and discard it.

Best Regards,

-- 
NIIBE Yutaka