summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorolah <olah@FreeBSD.org>1995-10-29 21:30:25 +0000
committerolah <olah@FreeBSD.org>1995-10-29 21:30:25 +0000
commit9e5e91cf157c1e6703bfeb4bd6dc376699919c8b (patch)
tree5ddc68fcc8a0dc85c0613c047dbdd3ed027507b6 /sys/netinet
parentcd0669e5850fa92d1173b7b7d13a375bd7d7ec76 (diff)
downloadFreeBSD-src-9e5e91cf157c1e6703bfeb4bd6dc376699919c8b.zip
FreeBSD-src-9e5e91cf157c1e6703bfeb4bd6dc376699919c8b.tar.gz
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
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/tcp_usrreq.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index bb55c0f..ab4c5c9 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -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);
}
OpenPOWER on IntegriCloud