diff options
| author | David Greenman <dg@FreeBSD.org> | 1995-07-29 18:48:44 +0000 | 
|---|---|---|
| committer | David Greenman <dg@FreeBSD.org> | 1995-07-29 18:48:44 +0000 | 
| commit | cc0964fb2b1cbb350d076c83cbc50ffc0d4069a8 (patch) | |
| tree | f0e3e8247b87e2cfe3801469917d01acb4b4dbcc /sys/netinet/tcp_timer.c | |
| parent | d242a09dae35e64e81ab84b823cef86158ddf39a (diff) | |
Notes
Diffstat (limited to 'sys/netinet/tcp_timer.c')
| -rw-r--r-- | sys/netinet/tcp_timer.c | 18 | 
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index ddab8d6d4b28..9badee0f24cd 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -31,7 +31,7 @@   * SUCH DAMAGE.   *   *	@(#)tcp_timer.c	8.1 (Berkeley) 6/10/93 - * $Id: tcp_timer.c,v 1.6 1995/04/12 06:49:56 davidg Exp $ + * $Id: tcp_timer.c,v 1.7 1995/05/30 08:09:59 rgrimes Exp $   */  #ifndef TUBA_INCLUDE @@ -63,6 +63,8 @@  int	tcp_keepidle = TCPTV_KEEP_IDLE;  int	tcp_keepintvl = TCPTV_KEEPINTVL;  int	tcp_maxidle; +int	tcp_maxpersistidle = TCPTV_KEEP_IDLE; +int	tcp_totbackoff = 511;  #endif /* TUBA_INCLUDE */  /*   * Fast timeout routine for processing delayed acks @@ -266,6 +268,20 @@ tcp_timers(tp, timer)  	 */  	case TCPT_PERSIST:  		tcpstat.tcps_persisttimeo++; +		/* +		 * Hack: if the peer is dead/unreachable, we do not +		 * time out if the window is closed.  After a full +		 * backoff, drop the connection if the idle time +		 * (no responses to probes) reaches the maximum +		 * backoff that we would use if retransmitting. +		 */ +		if (tp->t_rxtshift == TCP_MAXRXTSHIFT && +		    (tp->t_idle >= tcp_maxpersistidle || +		    tp->t_idle >= TCP_REXMTVAL(tp) * tcp_totbackoff)) { +		        tcpstat.tcps_persistdrop++; +		        tp = tcp_drop(tp, ETIMEDOUT); +		        break; +		}  		tcp_setpersist(tp);  		tp->t_force = 1;  		(void) tcp_output(tp);  | 
