diff options
author | jdp <jdp@FreeBSD.org> | 1996-06-03 15:37:52 +0000 |
---|---|---|
committer | jdp <jdp@FreeBSD.org> | 1996-06-03 15:37:52 +0000 |
commit | cd913c001e6542e96ed33d5a5071a97e67f9b816 (patch) | |
tree | be0041b17b4e88ec66f075924618019009a0abbc /sys/netinet/tcp_timer.c | |
parent | ca4dbe0a3e8607f8ca13a731f83b2b8432360f95 (diff) | |
download | FreeBSD-src-cd913c001e6542e96ed33d5a5071a97e67f9b816.zip FreeBSD-src-cd913c001e6542e96ed33d5a5071a97e67f9b816.tar.gz |
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>
Diffstat (limited to 'sys/netinet/tcp_timer.c')
-rw-r--r-- | sys/netinet/tcp_timer.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index 776d076..8fbac15 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.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; |