From da2cd7eb8208a07c0a752bb334cd336e6042b98a Mon Sep 17 00:00:00 2001 From: mycroft Date: Tue, 10 Sep 1996 23:26:05 +0000 Subject: [PATCH] If we're in SYN-SENT or SYN-RECEIVED state, don't reset the keepalive timer until we transition to ESTABLISHED state. Suggested by TCP/IP vol 3. --- sys/netinet/tcp_input.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index a6fe24e2651d..58291ff0a372 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_input.c,v 1.24 1996/09/09 14:51:20 mycroft Exp $ */ +/* $NetBSD: tcp_input.c,v 1.25 1996/09/10 23:26:05 mycroft Exp $ */ /* * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994 @@ -423,7 +423,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, @@ -667,6 +668,7 @@ findpcb: tcpstat.tcps_connects++; soisconnected(so); tp->t_state = TCPS_ESTABLISHED; + tp->t_timer[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)) { @@ -910,6 +912,7 @@ trimthenstep6: tcpstat.tcps_connects++; soisconnected(so); tp->t_state = TCPS_ESTABLISHED; + tp->t_timer[TCPT_KEEP] = tcp_keepidle; /* Do window scaling? */ if ((tp->t_flags & (TF_RCVD_SCALE|TF_REQ_SCALE)) == (TF_RCVD_SCALE|TF_REQ_SCALE)) {