diff options
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r-- | net/ipv4/tcp_output.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index c5cfd5ec3184..27a32acfdb62 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -2864,6 +2864,7 @@ static int tcp_send_syn_data(struct sock *sk, struct sk_buff *syn) | |||
2864 | struct sk_buff *syn_data = NULL, *data; | 2864 | struct sk_buff *syn_data = NULL, *data; |
2865 | unsigned long last_syn_loss = 0; | 2865 | unsigned long last_syn_loss = 0; |
2866 | 2866 | ||
2867 | tp->rx_opt.mss_clamp = tp->advmss; /* If MSS is not cached */ | ||
2867 | tcp_fastopen_cache_get(sk, &tp->rx_opt.mss_clamp, &fo->cookie, | 2868 | tcp_fastopen_cache_get(sk, &tp->rx_opt.mss_clamp, &fo->cookie, |
2868 | &syn_loss, &last_syn_loss); | 2869 | &syn_loss, &last_syn_loss); |
2869 | /* Recurring FO SYN losses: revert to regular handshake temporarily */ | 2870 | /* Recurring FO SYN losses: revert to regular handshake temporarily */ |
@@ -2873,7 +2874,9 @@ static int tcp_send_syn_data(struct sock *sk, struct sk_buff *syn) | |||
2873 | goto fallback; | 2874 | goto fallback; |
2874 | } | 2875 | } |
2875 | 2876 | ||
2876 | if (fo->cookie.len <= 0) | 2877 | if (sysctl_tcp_fastopen & TFO_CLIENT_NO_COOKIE) |
2878 | fo->cookie.len = -1; | ||
2879 | else if (fo->cookie.len <= 0) | ||
2877 | goto fallback; | 2880 | goto fallback; |
2878 | 2881 | ||
2879 | /* MSS for SYN-data is based on cached MSS and bounded by PMTU and | 2882 | /* MSS for SYN-data is based on cached MSS and bounded by PMTU and |
@@ -2916,6 +2919,7 @@ static int tcp_send_syn_data(struct sock *sk, struct sk_buff *syn) | |||
2916 | fo->copied = data->len; | 2919 | fo->copied = data->len; |
2917 | 2920 | ||
2918 | if (tcp_transmit_skb(sk, syn_data, 0, sk->sk_allocation) == 0) { | 2921 | if (tcp_transmit_skb(sk, syn_data, 0, sk->sk_allocation) == 0) { |
2922 | tp->syn_data = (fo->copied > 0); | ||
2919 | NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPFASTOPENACTIVE); | 2923 | NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPFASTOPENACTIVE); |
2920 | goto done; | 2924 | goto done; |
2921 | } | 2925 | } |