diff options
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r-- | sys/netinet/tcp_subr.c | 112 |
1 files changed, 1 insertions, 111 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index c46ec66bc9a..62bd67be1ce 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_subr.c,v 1.78 2004/04/26 18:12:25 frantzen Exp $ */ +/* $OpenBSD: tcp_subr.c,v 1.79 2004/05/04 22:50:18 claudio Exp $ */ /* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */ /* @@ -573,116 +573,6 @@ tcp_close(struct tcpcb *tp) #ifdef TCP_SACK struct sackhole *p, *q; #endif -#ifdef RTV_RTT - struct rtentry *rt; -#ifdef INET6 - int bound_to_specific = 0; /* I.e. non-default */ - - /* - * This code checks the nature of the route for this connection. - * Normally this is done by two simple checks in the next - * INET/INET6 ifdef block, but because of two possible lower layers, - * that check is done here. - * - * Perhaps should be doing this only for a RTF_HOST route. - */ - rt = inp->inp_route.ro_rt; /* Same for route or route6. */ - if (tp->pf == PF_INET6) { - if (rt) - bound_to_specific = - !(IN6_IS_ADDR_UNSPECIFIED(& - ((struct sockaddr_in6 *)rt_key(rt))->sin6_addr)); - } else { - if (rt) - bound_to_specific = - (((struct sockaddr_in *)rt_key(rt))-> - sin_addr.s_addr != INADDR_ANY); - } -#endif /* INET6 */ - - /* - * If we sent enough data to get some meaningful characteristics, - * save them in the routing entry. 'Enough' is arbitrarily - * defined as the sendpipesize (default 4K) * 16. This would - * give us 16 rtt samples assuming we only get one sample per - * window (the usual case on a long haul net). 16 samples is - * enough for the srtt filter to converge to within 5% of the correct - * value; fewer samples and we could save a very bogus rtt. - * - * Don't update the default route's characteristics and don't - * update anything that the user "locked". - */ -#ifdef INET6 - /* - * Note that rt and bound_to_specific are set above. - */ - if (SEQ_LT(tp->iss + so->so_snd.sb_hiwat * 16, tp->snd_max) && - rt && bound_to_specific) { -#else /* INET6 */ - if (SEQ_LT(tp->iss + so->so_snd.sb_hiwat * 16, tp->snd_max) && - (rt = inp->inp_route.ro_rt) && - satosin(rt_key(rt))->sin_addr.s_addr != INADDR_ANY) { -#endif /* INET6 */ - u_long i = 0; - - if ((rt->rt_rmx.rmx_locks & RTV_RTT) == 0) { - i = tp->t_srtt * - (RTM_RTTUNIT / (PR_SLOWHZ * TCP_RTT_SCALE)); - if (rt->rt_rmx.rmx_rtt && i) - /* - * filter this update to half the old & half - * the new values, converting scale. - * See route.h and tcp_var.h for a - * description of the scaling constants. - */ - rt->rt_rmx.rmx_rtt = - (rt->rt_rmx.rmx_rtt + i) / 2; - else - rt->rt_rmx.rmx_rtt = i; - } - if ((rt->rt_rmx.rmx_locks & RTV_RTTVAR) == 0) { - i = tp->t_rttvar * - (RTM_RTTUNIT / (PR_SLOWHZ * TCP_RTTVAR_SCALE)); - if (rt->rt_rmx.rmx_rttvar && i) - rt->rt_rmx.rmx_rttvar = - (rt->rt_rmx.rmx_rttvar + i) / 2; - else - rt->rt_rmx.rmx_rttvar = i; - } - /* - * update the pipelimit (ssthresh) if it has been updated - * already or if a pipesize was specified & the threshhold - * got below half the pipesize. I.e., wait for bad news - * before we start updating, then update on both good - * and bad news. - */ - if (((rt->rt_rmx.rmx_locks & RTV_SSTHRESH) == 0 && - (i = tp->snd_ssthresh) && rt->rt_rmx.rmx_ssthresh) || - i < (rt->rt_rmx.rmx_sendpipe / 2)) { - /* - * convert the limit from user data bytes to - * packets then to packet data bytes. - */ - i = (i + tp->t_maxseg / 2) / tp->t_maxseg; - if (i < 2) - i = 2; -#ifdef INET6 - if (tp->pf == PF_INET6) - i *= (u_long)(tp->t_maxseg + sizeof (struct tcphdr) - + sizeof(struct ip6_hdr)); - else -#endif /* INET6 */ - i *= (u_long)(tp->t_maxseg + - sizeof (struct tcpiphdr)); - - if (rt->rt_rmx.rmx_ssthresh) - rt->rt_rmx.rmx_ssthresh = - (rt->rt_rmx.rmx_ssthresh + i) / 2; - else - rt->rt_rmx.rmx_ssthresh = i; - } - } -#endif /* RTV_RTT */ /* free the reassembly queue, if any */ tcp_reass_lock(tp); |