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:
parent
5bf514a380
commit
f885f63606
@ -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;
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user