aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_output.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r--net/ipv4/tcp_output.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 694711a140d4..3d61c52bdf79 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -627,7 +627,7 @@ static unsigned int tcp_synack_options(struct sock *sk,
627 if (unlikely(!ireq->tstamp_ok)) 627 if (unlikely(!ireq->tstamp_ok))
628 remaining -= TCPOLEN_SACKPERM_ALIGNED; 628 remaining -= TCPOLEN_SACKPERM_ALIGNED;
629 } 629 }
630 if (foc != NULL) { 630 if (foc != NULL && foc->len >= 0) {
631 u32 need = TCPOLEN_EXP_FASTOPEN_BASE + foc->len; 631 u32 need = TCPOLEN_EXP_FASTOPEN_BASE + foc->len;
632 need = (need + 3) & ~3U; /* Align to 32 bits */ 632 need = (need + 3) & ~3U; /* Align to 32 bits */
633 if (remaining >= need) { 633 if (remaining >= need) {
@@ -2803,27 +2803,6 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst,
2803 if (tp->rx_opt.user_mss && tp->rx_opt.user_mss < mss) 2803 if (tp->rx_opt.user_mss && tp->rx_opt.user_mss < mss)
2804 mss = tp->rx_opt.user_mss; 2804 mss = tp->rx_opt.user_mss;
2805 2805
2806 if (req->rcv_wnd == 0) { /* ignored for retransmitted syns */
2807 __u8 rcv_wscale;
2808 /* Set this up on the first call only */
2809 req->window_clamp = tp->window_clamp ? : dst_metric(dst, RTAX_WINDOW);
2810
2811 /* limit the window selection if the user enforce a smaller rx buffer */
2812 if (sk->sk_userlocks & SOCK_RCVBUF_LOCK &&
2813 (req->window_clamp > tcp_full_space(sk) || req->window_clamp == 0))
2814 req->window_clamp = tcp_full_space(sk);
2815
2816 /* tcp_full_space because it is guaranteed to be the first packet */
2817 tcp_select_initial_window(tcp_full_space(sk),
2818 mss - (ireq->tstamp_ok ? TCPOLEN_TSTAMP_ALIGNED : 0),
2819 &req->rcv_wnd,
2820 &req->window_clamp,
2821 ireq->wscale_ok,
2822 &rcv_wscale,
2823 dst_metric(dst, RTAX_INITRWND));
2824 ireq->rcv_wscale = rcv_wscale;
2825 }
2826
2827 memset(&opts, 0, sizeof(opts)); 2806 memset(&opts, 0, sizeof(opts));
2828#ifdef CONFIG_SYN_COOKIES 2807#ifdef CONFIG_SYN_COOKIES
2829 if (unlikely(req->cookie_ts)) 2808 if (unlikely(req->cookie_ts))