Start the 2MSL timer when the socket is closed and the TCP connection is

in the FIN_WAIT_2 state in order to prevent the conn. hanging there
forever.

Reviewed by:	davidg, olah
Submitted by:	Arne Henrik Juul <arnej@imf.unit.no>
Obtained from:	bugs@netbsd.org
This commit is contained in:
Andras Olah 1995-10-29 21:30:25 +00:00
parent 9968a350e9
commit b6239c4a19
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=11928

View file

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* From: @(#)tcp_usrreq.c 8.2 (Berkeley) 1/3/94
* $Id: tcp_usrreq.c,v 1.15 1995/06/11 19:31:43 rgrimes Exp $
* $Id: tcp_usrreq.c,v 1.16 1995/09/13 17:54:03 wollman Exp $
*/
#include <sys/param.h>
@ -674,8 +674,12 @@ tcp_usrclosed(tp)
tp->t_state = TCPS_LAST_ACK;
break;
}
if (tp && tp->t_state >= TCPS_FIN_WAIT_2)
if (tp && tp->t_state >= TCPS_FIN_WAIT_2) {
soisdisconnected(tp->t_inpcb->inp_socket);
/* To prevent the connection hanging in FIN_WAIT_2 forever. */
if (tp->t_state == TCPS_FIN_WAIT_2)
tp->t_timer[TCPT_2MSL] = tcp_maxidle;
}
return (tp);
}