1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

Fix a bug in the handling of the "persist" state which, under certain

circumstances, caused perfectly good connections to be dropped.  This
happened for connections over a LAN, where the retransmit timer
calculation TCP_REXMTVAL(tp) returned 0.  If sending was blocked by flow
control for long enough, the old code dropped the connection, even
though timely replies were being received for all window probes.

Reviewed by:	W. Richard Stevens <rstevens@noao.edu>
This commit is contained in:
John Polstra 1996-06-03 15:37:52 +00:00
parent 18182fa7a3
commit 588c92252f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=16099

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_timer.c 8.2 (Berkeley) 5/24/95
* $Id: tcp_timer.c,v 1.15 1996/04/04 11:17:04 phk Exp $
* $Id: tcp_timer.c,v 1.16 1996/04/15 03:46:33 davidg Exp $
*/
#ifndef TUBA_INCLUDE
@ -297,12 +297,17 @@ tcp_timers(tp, timer)
* (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;
if (tp->t_rxtshift == TCP_MAXRXTSHIFT) {
u_long maxidle = TCP_REXMTVAL(tp);
if (maxidle < tp->t_rttmin)
maxidle = tp->t_rttmin;
maxidle *= tcp_totbackoff;
if (tp->t_idle >= tcp_maxpersistidle ||
tp->t_idle >= maxidle) {
tcpstat.tcps_persistdrop++;
tp = tcp_drop(tp, ETIMEDOUT);
break;
}
}
tcp_setpersist(tp);
tp->t_force = 1;