From 7b40aa327dde148ea4fccc538d68ec8cd274030e Mon Sep 17 00:00:00 2001 From: Paul Traina Date: Fri, 13 Sep 1996 23:51:44 +0000 Subject: [PATCH] Make the misnamed tcp initial keepalive timer value (which is really the time, in seconds, that state for non-established TCP sessions stays about) a sysctl modifyable variable. [part 1 of two commits, I just realized I can't play with the indices as I was typing this commit message.] --- sys/netinet/tcp_input.c | 6 +++--- sys/netinet/tcp_reass.c | 6 +++--- sys/netinet/tcp_timer.c | 6 +++++- sys/netinet/tcp_timer.h | 3 ++- sys/netinet/tcp_usrreq.c | 4 ++-- sys/netinet/tcp_var.h | 10 ++++++---- 6 files changed, 21 insertions(+), 14 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 329cf2504931..75a33e6e840e 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_input.c 8.12 (Berkeley) 5/24/95 - * $Id: tcp_input.c,v 1.46 1996/05/02 05:54:12 fenner Exp $ + * $Id: tcp_input.c,v 1.47 1996/09/13 18:47:03 pst Exp $ */ #ifndef TUBA_INCLUDE @@ -715,7 +715,7 @@ findpcb: tp->rcv_adv += min(tp->rcv_wnd, TCP_MAXWIN); tcpstat.tcps_connects++; soisconnected(so); - tp->t_timer[TCPT_KEEP] = TCPTV_KEEP_INIT; + tp->t_timer[TCPT_KEEP] = tcp_keepinit; dropsocket = 0; /* committed to socket */ tcpstat.tcps_accepts++; goto trimthenstep6; @@ -734,7 +734,7 @@ findpcb: */ tp->t_flags |= TF_ACKNOW; tp->t_state = TCPS_SYN_RECEIVED; - tp->t_timer[TCPT_KEEP] = TCPTV_KEEP_INIT; + tp->t_timer[TCPT_KEEP] = tcp_keepinit; dropsocket = 0; /* committed to socket */ tcpstat.tcps_accepts++; goto trimthenstep6; diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index 329cf2504931..75a33e6e840e 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.46 1996/05/02 05:54:12 fenner Exp $ + * $Id: tcp_input.c,v 1.47 1996/09/13 18:47:03 pst Exp $ */ #ifndef TUBA_INCLUDE @@ -715,7 +715,7 @@ findpcb: tp->rcv_adv += min(tp->rcv_wnd, TCP_MAXWIN); tcpstat.tcps_connects++; soisconnected(so); - tp->t_timer[TCPT_KEEP] = TCPTV_KEEP_INIT; + tp->t_timer[TCPT_KEEP] = tcp_keepinit; dropsocket = 0; /* committed to socket */ tcpstat.tcps_accepts++; goto trimthenstep6; @@ -734,7 +734,7 @@ findpcb: */ tp->t_flags |= TF_ACKNOW; tp->t_state = TCPS_SYN_RECEIVED; - tp->t_timer[TCPT_KEEP] = TCPTV_KEEP_INIT; + tp->t_timer[TCPT_KEEP] = tcp_keepinit; dropsocket = 0; /* committed to socket */ tcpstat.tcps_accepts++; goto trimthenstep6; diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index 73396b3a3b88..fd477b9504af 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_timer.c 8.2 (Berkeley) 5/24/95 - * $Id: tcp_timer.c,v 1.18 1996/07/11 16:32:35 wollman Exp $ + * $Id: tcp_timer.c,v 1.19 1996/07/12 17:28:46 davidg Exp $ */ #ifndef TUBA_INCLUDE @@ -67,6 +67,10 @@ #include #endif +int tcp_keepinit = TCPTV_KEEP_INIT; +SYSCTL_INT(_net_inet_tcp, TCPCTL_KEEPINIT, keepinit, + CTLFLAG_RW, &tcp_keepinit , 0, ""); + int tcp_keepidle = TCPTV_KEEP_IDLE; SYSCTL_INT(_net_inet_tcp, TCPCTL_KEEPIDLE, keepidle, CTLFLAG_RW, &tcp_keepidle , 0, ""); diff --git a/sys/netinet/tcp_timer.h b/sys/netinet/tcp_timer.h index f431b017ac10..df501d1c178b 100644 --- a/sys/netinet/tcp_timer.h +++ b/sys/netinet/tcp_timer.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_timer.h 8.1 (Berkeley) 6/10/93 - * $Id: tcp_timer.h,v 1.8 1996/01/30 22:58:29 mpp Exp $ + * $Id: tcp_timer.h,v 1.9 1996/06/14 17:17:32 wollman Exp $ */ #ifndef _NETINET_TCP_TIMER_H_ @@ -127,6 +127,7 @@ static char *tcptimers[] = } #ifdef KERNEL +extern int tcp_keepinit; /* time to establish connection */ extern int tcp_keepidle; /* time before keepalive probes begin */ extern int tcp_keepintvl; /* time between keepalive probes */ extern int tcp_maxidle; /* time to drop after starting probes */ diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 9fb4d48a8f6b..78f8acf71fd4 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.23 1996/07/11 16:32:38 wollman Exp $ + * $Id: tcp_usrreq.c,v 1.24 1996/07/12 17:28:47 davidg Exp $ */ #include @@ -891,7 +891,7 @@ tcp_connect(tp, nam) soisconnecting(so); tcpstat.tcps_connattempt++; tp->t_state = TCPS_SYN_SENT; - tp->t_timer[TCPT_KEEP] = TCPTV_KEEP_INIT; + tp->t_timer[TCPT_KEEP] = tcp_keepinit; tp->iss = tcp_iss; tcp_iss += TCP_ISSINCR/2; tcp_sendseqinit(tp); diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 4717e5d4f93a..06836c20d391 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_var.h 8.4 (Berkeley) 5/24/95 - * $Id: tcp_var.h,v 1.33 1996/06/05 16:57:38 wollman Exp $ + * $Id: tcp_var.h,v 1.34 1996/07/11 16:32:40 wollman Exp $ */ #ifndef _NETINET_TCP_VAR_H_ @@ -307,9 +307,10 @@ struct tcpstat { #define TCPCTL_RTTDFLT 5 /* default RTT estimate */ #define TCPCTL_KEEPIDLE 6 /* keepalive idle timer */ #define TCPCTL_KEEPINTVL 7 /* interval to send keepalives */ -#define TCPCTL_SENDSPACE 8 /* send buffer space */ -#define TCPCTL_RECVSPACE 9 /* receive buffer space */ -#define TCPCTL_MAXID 10 +#define TCPCTL_KEEPINIT 8 /* timeout for establishing syn */ +#define TCPCTL_SENDSPACE 9 /* send buffer space */ +#define TCPCTL_RECVSPACE 10 /* receive buffer space */ +#define TCPCTL_MAXID 11 #define TCPCTL_NAMES { \ { 0, 0 }, \ @@ -320,6 +321,7 @@ struct tcpstat { { "rttdflt", CTLTYPE_INT }, \ { "keepidle", CTLTYPE_INT }, \ { "keepintvl", CTLTYPE_INT }, \ + { "keepinit", CTLTYPE_INT }, \ { "sendspace", CTLTYPE_INT }, \ { "recvspace", CTLTYPE_INT }, \ }