Limit the maximum permissible TCP window size to 65535 octets if

window scaling is disabled.

PR:		kern/16914
Submitted by:	Jayanth Vijayaraghavan <jayanth@yahoo-inc.com>
Reviewed by:	wollman
Approved by:	jkh
This commit is contained in:
Paul Saab 2000-02-28 21:18:21 +00:00
parent 5bf514a380
commit f885f63606
2 changed files with 8 additions and 2 deletions

View File

@ -314,8 +314,11 @@ tcp_respond(tp, ipgen, th, m, ack, seq, flags)
ipov = ipgen; ipov = ipgen;
if (tp) { if (tp) {
if (!(flags & TH_RST)) if (!(flags & TH_RST)) {
win = sbspace(&tp->t_inpcb->inp_socket->so_rcv); win = sbspace(&tp->t_inpcb->inp_socket->so_rcv);
if (win > (long)TCP_MAXWIN << tp->rcv_scale)
win = (long)TCP_MAXWIN << tp->rcv_scale;
}
#ifdef INET6 #ifdef INET6
if (isipv6) if (isipv6)
ro6 = &tp->t_inpcb->in6p_route; ro6 = &tp->t_inpcb->in6p_route;

View File

@ -314,8 +314,11 @@ tcp_respond(tp, ipgen, th, m, ack, seq, flags)
ipov = ipgen; ipov = ipgen;
if (tp) { if (tp) {
if (!(flags & TH_RST)) if (!(flags & TH_RST)) {
win = sbspace(&tp->t_inpcb->inp_socket->so_rcv); win = sbspace(&tp->t_inpcb->inp_socket->so_rcv);
if (win > (long)TCP_MAXWIN << tp->rcv_scale)
win = (long)TCP_MAXWIN << tp->rcv_scale;
}
#ifdef INET6 #ifdef INET6
if (isipv6) if (isipv6)
ro6 = &tp->t_inpcb->in6p_route; ro6 = &tp->t_inpcb->in6p_route;