]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - net/ipv4/tcp_output.c
[PATCH] fs: fix nobh data leak
[mv-sheeva.git] / net / ipv4 / tcp_output.c
index cebe9aa918a355c039fe2f014a8a88cc88603e4e..dc151139b5afbe642a2b9245f3795dc5d688f0f1 100644 (file)
@@ -481,7 +481,7 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,
                /* RFC1323: The window in SYN & SYN/ACK segments
                 * is never scaled.
                 */
-               th->window      = htons(tp->rcv_wnd);
+               th->window      = htons(min(tp->rcv_wnd, 65535U));
        } else {
                th->window      = htons(tcp_select_window(sk));
        }
@@ -2160,7 +2160,7 @@ struct sk_buff * tcp_make_synack(struct sock *sk, struct dst_entry *dst,
        }
 
        /* RFC1323: The window in SYN & SYN/ACK segments is never scaled. */
-       th->window = htons(req->rcv_wnd);
+       th->window = htons(min(req->rcv_wnd, 65535U));
 
        TCP_SKB_CB(skb)->when = tcp_time_stamp;
        tcp_syn_build_options((__be32 *)(th + 1), dst_metric(dst, RTAX_ADVMSS), ireq->tstamp_ok,