diff options
author | wollman <wollman@FreeBSD.org> | 1996-06-05 16:57:38 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1996-06-05 16:57:38 +0000 |
commit | 63dc6bde0f5c1d7fba259a7287ef49d65338a72d (patch) | |
tree | 6aeb9f9911d474b15c9349bf64c57e77e0a785e8 /sys/netinet | |
parent | 8f86d5aeb7d5fb40bccebdbb159a30dbe16ec37e (diff) | |
download | FreeBSD-src-63dc6bde0f5c1d7fba259a7287ef49d65338a72d.zip FreeBSD-src-63dc6bde0f5c1d7fba259a7287ef49d65338a72d.tar.gz |
Correct formula for TCP RTO calculation. Also try to do a better job in
filling in a new PCB's rttvar (but this is not the last word on the subject).
And get rid of `#ifdef RTV_RTT', it's been true for four years now...
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/tcp_subr.c | 6 | ||||
-rw-r--r-- | sys/netinet/tcp_timewait.c | 6 | ||||
-rw-r--r-- | sys/netinet/tcp_var.h | 6 |
3 files changed, 7 insertions, 11 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 87137f4..c3100f3 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95 - * $Id: tcp_subr.c,v 1.27 1996/03/22 18:11:25 wollman Exp $ + * $Id: tcp_subr.c,v 1.28 1996/03/27 18:23:16 wollman Exp $ */ #include <sys/param.h> @@ -270,7 +270,7 @@ tcp_newtcpcb(inp) * reasonable initial retransmit time. */ tp->t_srtt = TCPTV_SRTTBASE; - tp->t_rttvar = tcp_rttdflt * PR_SLOWHZ << 2; + tp->t_rttvar = tcp_rttdflt * PR_SLOWHZ << TCP_RTTVAR_SHIFT; tp->t_rttmin = TCPTV_MIN; TCPT_RANGESET(tp->t_rxtcur, ((TCPTV_SRTTBASE >> 2) + (TCPTV_SRTTDFLT << 2)) >> 1, @@ -320,7 +320,6 @@ tcp_close(tp) struct inpcb *inp = tp->t_inpcb; struct socket *so = inp->inp_socket; register struct mbuf *m; -#ifdef RTV_RTT register struct rtentry *rt; /* @@ -391,7 +390,6 @@ tcp_close(tp) tcpstat.tcps_cachedssthresh++; } } -#endif /* RTV_RTT */ /* free the reassembly queue, if any */ t = tp->seg_next; while (t != (struct tcpiphdr *)tp) { diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index 87137f4..c3100f3 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95 - * $Id: tcp_subr.c,v 1.27 1996/03/22 18:11:25 wollman Exp $ + * $Id: tcp_subr.c,v 1.28 1996/03/27 18:23:16 wollman Exp $ */ #include <sys/param.h> @@ -270,7 +270,7 @@ tcp_newtcpcb(inp) * reasonable initial retransmit time. */ tp->t_srtt = TCPTV_SRTTBASE; - tp->t_rttvar = tcp_rttdflt * PR_SLOWHZ << 2; + tp->t_rttvar = tcp_rttdflt * PR_SLOWHZ << TCP_RTTVAR_SHIFT; tp->t_rttmin = TCPTV_MIN; TCPT_RANGESET(tp->t_rxtcur, ((TCPTV_SRTTBASE >> 2) + (TCPTV_SRTTDFLT << 2)) >> 1, @@ -320,7 +320,6 @@ tcp_close(tp) struct inpcb *inp = tp->t_inpcb; struct socket *so = inp->inp_socket; register struct mbuf *m; -#ifdef RTV_RTT register struct rtentry *rt; /* @@ -391,7 +390,6 @@ tcp_close(tp) tcpstat.tcps_cachedssthresh++; } } -#endif /* RTV_RTT */ /* free the reassembly queue, if any */ t = tp->seg_next; while (t != (struct tcpiphdr *)tp) { diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index f8ad951..8152eaf 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.31 1996/03/22 18:09:21 wollman Exp $ + * $Id: tcp_var.h,v 1.32 1996/04/26 18:32:58 wollman Exp $ */ #ifndef _NETINET_TCP_VAR_H_ @@ -214,8 +214,8 @@ struct rmxp_tao { * fast networks. */ #define TCP_REXMTVAL(tp) \ - ((((tp)->t_srtt >> (TCP_RTT_SHIFT - TCP_RTTVAR_SHIFT)) \ - + ((tp)->t_rttvar) >> TCP_RTTVAR_SHIFT)) + ((((tp)->t_srtt >> (TCP_RTT_SHIFT - TCP_DELTA_SHIFT)) \ + + (tp)->t_rttvar) >> TCP_DELTA_SHIFT) /* XXX * We want to avoid doing m_pullup on incoming packets but that |