[Bug 217637] One TCP connection accepted TWO times

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Mar 19 17:10:55 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=217637

--- Comment #33 from Michael Tuexen <tuexen at freebsd.org> ---
(In reply to slw from comment #32)
The server does
socket()
listen()
accept()
read()
write()
close()
which means it reads the first part of the request, sends the response (en
error message) and closes the socket. Then the state is FIN-WAIT-1. Then it
receives the
second part of the request. Since the socket is closed, it responds with a RST
segment and moves the connection to CLOSED. This covers the first TCP
connection of the two.

After that that the client retransmits the complete request, which results in
establishing the second TCP connection (via the syncookie processing). The
server sends a response (the same error message) and closes the socket. So it
is again in FIN-WAIT-1. The FIN gets acked by the client. So the server goes
into FIN-WAIT-2. Then the client sends its fin. This is processed by the server
and acked. Now the server is in TIME-WAIT. However, the ACK is not received by
the client and the client retransmits the FIN-ACK.

So I don't see any end point moving into CLOSE-WAIT state...

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-net mailing list