summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_reass.c
diff options
context:
space:
mode:
authorpst <pst@FreeBSD.org>1996-09-13 18:47:03 +0000
committerpst <pst@FreeBSD.org>1996-09-13 18:47:03 +0000
commit3499a659641eaabaf4a588b971b73c22b5bdb43c (patch)
treea9dd6bb96c89292381f11fcf10d4dad9bea1e937 /sys/netinet/tcp_reass.c
parentf230d30a1e127a602bb526ad55f313f36ed628f0 (diff)
downloadFreeBSD-src-3499a659641eaabaf4a588b971b73c22b5bdb43c.zip
FreeBSD-src-3499a659641eaabaf4a588b971b73c22b5bdb43c.tar.gz
Receipt of two SYN's are sufficient to set the t_timer[TCPT_KEEP]
to "keepidle". this should not occur unless the connection has been established via the 3-way handshake which requires an ACK Submitted by: jmb Obtained from: problem discussed in Stevens vol. 3
Diffstat (limited to 'sys/netinet/tcp_reass.c')
-rw-r--r--sys/netinet/tcp_reass.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c
index 67f5716..329cf25 100644
--- a/sys/netinet/tcp_reass.c
+++ b/sys/netinet/tcp_reass.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_input.c 8.12 (Berkeley) 5/24/95
- * $Id: tcp_input.c,v 1.45 1996/05/02 05:31:12 fenner Exp $
+ * $Id: tcp_input.c,v 1.46 1996/05/02 05:54:12 fenner Exp $
*/
#ifndef TUBA_INCLUDE
@@ -450,7 +450,8 @@ findpcb:
* Reset idle time and keep-alive timer.
*/
tp->t_idle = 0;
- tp->t_timer[TCPT_KEEP] = tcp_keepidle;
+ if (TCPS_HAVEESTABLISHED(tp->t_state))
+ tp->t_timer[TCPT_KEEP] = tcp_keepidle;
/*
* Process options if not in LISTEN state,
@@ -832,9 +833,10 @@ findpcb:
tp->t_state = TCPS_FIN_WAIT_1;
tp->t_flags &= ~TF_NEEDFIN;
tiflags &= ~TH_SYN;
- } else
+ } else {
tp->t_state = TCPS_ESTABLISHED;
-
+ tp->t_timer[TCPT_KEEP] = tcp_keepidle;
+ }
} else {
/*
* Received initial SYN in SYN-SENT[*] state => simul-
@@ -859,8 +861,10 @@ findpcb:
if (tp->t_flags & TF_NEEDFIN) {
tp->t_state = TCPS_FIN_WAIT_1;
tp->t_flags &= ~TF_NEEDFIN;
- } else
+ } else {
tp->t_state = TCPS_ESTABLISHED;
+ tp->t_timer[TCPT_KEEP] = tcp_keepidle;
+ }
tp->t_flags |= TF_NEEDSYN;
} else
tp->t_state = TCPS_SYN_RECEIVED;
@@ -1183,8 +1187,10 @@ trimthenstep6:
if (tp->t_flags & TF_NEEDFIN) {
tp->t_state = TCPS_FIN_WAIT_1;
tp->t_flags &= ~TF_NEEDFIN;
- } else
+ } else {
tp->t_state = TCPS_ESTABLISHED;
+ tp->t_timer[TCPT_KEEP] = tcp_keepidle;
+ }
/*
* If segment contains data or ACK, will call tcp_reass()
* later; if not, do so now to pass queued data to user.
OpenPOWER on IntegriCloud