summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1998-04-24 09:25:39 +0000
committerdg <dg@FreeBSD.org>1998-04-24 09:25:39 +0000
commita30ffaa134c55eceb5da086e0a916593ad53d470 (patch)
tree7871e4986a12edeb8458643aa6a8b089f400e727 /sys
parentde78d409f5c0e756bc89d1d84f959c79752b22a1 (diff)
downloadFreeBSD-src-a30ffaa134c55eceb5da086e0a916593ad53d470.zip
FreeBSD-src-a30ffaa134c55eceb5da086e0a916593ad53d470.tar.gz
Ensure that TCP_REXMTVAL doesn't return a value less than t_rttmin. This
is believed to have been broken with the Brakmo/Peterson srtt calculation changes. The result of this bug is that TCP connections could time out extremely quickly (in 12 seconds). Also backed out jdp's partial fix for this problem in rev 1.17 of tcp_timer.c as it is obsoleted by this commit. Bug was pointed out by Kevin Lehey <kml@roller.nas.nasa.gov>. PR: 6068
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/tcp_timer.c19
-rw-r--r--sys/netinet/tcp_var.h4
2 files changed, 9 insertions, 14 deletions
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c
index 65ace37..112ce57 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.26 1998/02/26 05:25:33 dg Exp $
+ * $Id: tcp_timer.c,v 1.27 1998/04/06 06:52:46 phk Exp $
*/
#include "opt_compat.h"
@@ -308,17 +308,12 @@ tcp_timers(tp, timer)
* (no responses to probes) reaches the maximum
* backoff that we would use if retransmitting.
*/
- 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;
- }
+ 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;
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h
index fdeeecf..e928449 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.41 1998/02/26 05:25:39 dg Exp $
+ * $Id: tcp_var.h,v 1.42 1998/04/06 06:52:47 phk Exp $
*/
#ifndef _NETINET_TCP_VAR_H_
@@ -203,7 +203,7 @@ struct rmxp_tao {
* fast networks.
*/
#define TCP_REXMTVAL(tp) \
- ((((tp)->t_srtt >> (TCP_RTT_SHIFT - TCP_DELTA_SHIFT)) \
+ max((tp)->t_rttmin, (((tp)->t_srtt >> (TCP_RTT_SHIFT - TCP_DELTA_SHIFT)) \
+ (tp)->t_rttvar) >> TCP_DELTA_SHIFT)
/* XXX
OpenPOWER on IntegriCloud