summaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_input.c
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2004-01-29 17:02:57 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2004-01-29 17:02:57 +0000
commit7d11b08d630592a1c0e60bbf5261fbe20291f1d9 (patch)
treeb05c09df55df5813024b4556c925ed70639a3ea1 /sys/netinet/tcp_input.c
parente8f8f3f0afb1bdee1fa4da22daed0c97641615ea (diff)
reset TCPT_KEEP to tcp_keepidle when switching to ESTABLISHED;
ok henning, deraadt
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r--sys/netinet/tcp_input.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 1dbc76d7477..a4c52165f0c 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_input.c,v 1.150 2004/01/29 13:30:18 markus Exp $ */
+/* $OpenBSD: tcp_input.c,v 1.151 2004/01/29 17:02:56 markus Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
@@ -941,7 +941,7 @@ after_listen:
* Reset idle time and keep-alive timer.
*/
tp->t_rcvtime = tcp_now;
- if (tp->t_state != TCPS_SYN_RECEIVED)
+ if (TCPS_HAVEESTABLISHED(tp->t_state))
TCP_TIMER_ARM(tp, TCPT_KEEP, tcp_keepidle);
#ifdef TCP_SACK
@@ -1215,6 +1215,7 @@ after_listen:
tcpstat.tcps_connects++;
soisconnected(so);
tp->t_state = TCPS_ESTABLISHED;
+ TCP_TIMER_ARM(tp, TCPT_KEEP, tcp_keepidle);
/* Do window scaling on this connection? */
if ((tp->t_flags & (TF_RCVD_SCALE|TF_REQ_SCALE)) ==
(TF_RCVD_SCALE|TF_REQ_SCALE)) {
@@ -1468,6 +1469,7 @@ trimthenstep6:
tcpstat.tcps_connects++;
soisconnected(so);
tp->t_state = TCPS_ESTABLISHED;
+ TCP_TIMER_ARM(tp, TCPT_KEEP, tcp_keepidle);
/* Do window scaling? */
if ((tp->t_flags & (TF_RCVD_SCALE|TF_REQ_SCALE)) ==
(TF_RCVD_SCALE|TF_REQ_SCALE)) {