A connection in TIME_WAIT state before calling close() actually did not

received any RST packet.  Do not set error to ECONNRESET in this case.

Differential Revision:	https://reviews.freebsd.org/D879
Reviewed by:		rpaulo, adrian
Approved by:		jhb (mentor)
Sponsored by:		Verisign, Inc.
This commit is contained in:
Julien Charbon 2014-10-12 23:01:25 +00:00
parent f96f5e21e0
commit 489dcc9262
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=273014

View File

@ -592,7 +592,9 @@ tcp_usr_disconnect(struct socket *so)
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("tcp_usr_disconnect: inp == NULL"));
INP_WLOCK(inp);
if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
if (inp->inp_flags & INP_TIMEWAIT)
goto out;
if (inp->inp_flags & INP_DROPPED) {
error = ECONNRESET;
goto out;
}