diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2005-02-27 13:22:57 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2005-02-27 13:22:57 +0000 |
commit | f7ffc60336c3b29374bb88ce7073a563594ed2dc (patch) | |
tree | 2514debb72274d851186531702dee584e82771e9 /sys/netinet/tcp_subr.c | |
parent | a458571f1903e5f772b13da17b87d5825a92a8d2 (diff) |
1. tcp_xmit_timer(): remove extra rtt decrement (t_rtttime is 0-based
while t_rtt was 1-based), update callers
2. define and use TCP_RTT_BASE_SHIFT instead of the hardcoded 2.
3. add missing shifts when t_srtt/t_rttvar are used.
4. update the comments: t_srtt uses 5 bits of fraction (not 3)
and t_rttvar uses 4 bits
5. remove obsolete/unused macros TCP_RTT_SCALE and TCP_RTTVAR_SCALE
6. make sure rttmin is not > TCPTV_REXMTMAX
parts from netbsd, ok mcbride, henning
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r-- | sys/netinet/tcp_subr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 28157fa463c..5eb89f30462 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_subr.c,v 1.86 2005/01/10 23:53:49 mcbride Exp $ */ +/* $OpenBSD: tcp_subr.c,v 1.87 2005/02/27 13:22:56 markus Exp $ */ /* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */ /* @@ -508,7 +508,8 @@ tcp_newtcpcb(struct inpcb *inp) * reasonable initial retransmit time. */ tp->t_srtt = TCPTV_SRTTBASE; - tp->t_rttvar = tcp_rttdflt * PR_SLOWHZ << (TCP_RTTVAR_SHIFT + 2 - 1); + tp->t_rttvar = tcp_rttdflt * PR_SLOWHZ << + (TCP_RTTVAR_SHIFT + TCP_RTT_BASE_SHIFT - 1); tp->t_rttmin = TCPTV_MIN; TCPT_RANGESET(tp->t_rxtcur, TCP_REXMTVAL(tp), TCPTV_MIN, TCPTV_REXMTMAX); |