1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00

compute correct window scale when recvpipe option is set in route; based

on diff from "Pete Kazmier" <pete@kazmier.com>
This commit is contained in:
provos 2000-07-11 16:53:22 +00:00
parent d4b58c4f4e
commit 7b1010162a
4 changed files with 24 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: tcp_input.c,v 1.66 2000/07/09 12:53:55 itojun Exp $ */
/* $OpenBSD: tcp_input.c,v 1.67 2000/07/11 16:53:22 provos Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
@ -761,9 +761,7 @@ findpcb:
/* Compute proper scaling value from buffer space
*/
while (tp->request_r_scale < TCP_MAX_WINSHIFT &&
TCP_MAXWIN << tp->request_r_scale < so->so_rcv.sb_hiwat)
tp->request_r_scale++;
tcp_rscale(tp, so->so_rcv.sb_hiwat);
}
}
@ -2914,6 +2912,10 @@ tcp_mss(tp, offer)
if (bufsize > sb_max)
bufsize = sb_max;
(void)sbreserve(&so->so_rcv, bufsize);
#ifdef RTV_RPIPE
if (rt->rt_rmx.rmx_recvpipe > 0)
tcp_rscale(tp, so->so_rcv.sb_hiwat);
#endif
}
tp->snd_cwnd = mss;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: tcp_subr.c,v 1.28 2000/07/05 22:51:10 itojun Exp $ */
/* $OpenBSD: tcp_subr.c,v 1.29 2000/07/11 16:53:22 provos Exp $ */
/* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */
/*
@ -662,6 +662,18 @@ tcp_drain()
}
/*
* Compute proper scaling value for receiver window from buffer space
*/
void
tcp_rscale(struct tcpcb *tp, u_long hiwat)
{
while (tp->request_r_scale < TCP_MAX_WINSHIFT &&
TCP_MAXWIN << tp->request_r_scale < hiwat)
tp->request_r_scale++;
}
/*
* Notify a tcp user of an asynchronous error;
* store error as soft error, but wake up user

View File

@ -1,4 +1,4 @@
/* $OpenBSD: tcp_usrreq.c,v 1.45 2000/07/06 05:24:45 itojun Exp $ */
/* $OpenBSD: tcp_usrreq.c,v 1.46 2000/07/11 16:53:22 provos Exp $ */
/* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */
/*
@ -300,9 +300,8 @@ tcp_usrreq(so, req, m, nam, control)
so->so_state |= SS_CONNECTOUT;
/* Compute window scaling to request. */
while (tp->request_r_scale < TCP_MAX_WINSHIFT &&
(TCP_MAXWIN << tp->request_r_scale) < so->so_rcv.sb_hiwat)
tp->request_r_scale++;
tcp_rscale(tp, so->so_rcv.sb_hiwat);
soisconnecting(so);
tcpstat.tcps_connattempt++;
tp->t_state = TCPS_SYN_SENT;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: tcp_var.h,v 1.28 2000/06/26 22:45:09 art Exp $ */
/* $OpenBSD: tcp_var.h,v 1.29 2000/07/11 16:53:22 provos Exp $ */
/* $NetBSD: tcp_var.h,v 1.17 1996/02/13 23:44:24 christos Exp $ */
/*
@ -350,6 +350,7 @@ int tcp_output __P((struct tcpcb *));
void tcp_pulloutofband __P((struct socket *, u_int, struct mbuf *, int));
void tcp_quench __P((struct inpcb *, int));
int tcp_reass __P((struct tcpcb *, struct tcphdr *, struct mbuf *, int *));
void tcp_rscale __P((struct tcpcb *, u_long));
void tcp_respond __P((struct tcpcb *, caddr_t, struct mbuf *, tcp_seq,
tcp_seq, int));
void tcp_setpersist __P((struct tcpcb *));