diff options
-rw-r--r-- | include/linux/tcp.h | 3 | ||||
-rw-r--r-- | include/uapi/linux/tcp.h | 1 | ||||
-rw-r--r-- | net/ipv4/tcp.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp_input.c | 1 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 1 | ||||
-rw-r--r-- | net/ipv4/tcp_minisocks.c | 1 |
6 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 8a7fc4be2d75..60b7aac15e0e 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -191,7 +191,8 @@ struct tcp_sock { | |||
191 | u8 do_early_retrans:1,/* Enable RFC5827 early-retransmit */ | 191 | u8 do_early_retrans:1,/* Enable RFC5827 early-retransmit */ |
192 | early_retrans_delayed:1, /* Delayed ER timer installed */ | 192 | early_retrans_delayed:1, /* Delayed ER timer installed */ |
193 | syn_data:1, /* SYN includes data */ | 193 | syn_data:1, /* SYN includes data */ |
194 | syn_fastopen:1; /* SYN includes Fast Open option */ | 194 | syn_fastopen:1, /* SYN includes Fast Open option */ |
195 | syn_data_acked:1;/* data in SYN is acked by SYN-ACK */ | ||
195 | 196 | ||
196 | /* RTT measurement */ | 197 | /* RTT measurement */ |
197 | u32 srtt; /* smoothed round trip time << 3 */ | 198 | u32 srtt; /* smoothed round trip time << 3 */ |
diff --git a/include/uapi/linux/tcp.h b/include/uapi/linux/tcp.h index c4b89a5cb7df..e962faa5ab0d 100644 --- a/include/uapi/linux/tcp.h +++ b/include/uapi/linux/tcp.h | |||
@@ -130,6 +130,7 @@ enum { | |||
130 | #define TCPI_OPT_WSCALE 4 | 130 | #define TCPI_OPT_WSCALE 4 |
131 | #define TCPI_OPT_ECN 8 /* ECN was negociated at TCP session init */ | 131 | #define TCPI_OPT_ECN 8 /* ECN was negociated at TCP session init */ |
132 | #define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */ | 132 | #define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */ |
133 | #define TCPI_OPT_SYN_DATA 32 /* SYN-ACK acked data in SYN sent or rcvd */ | ||
133 | 134 | ||
134 | enum tcp_ca_state { | 135 | enum tcp_ca_state { |
135 | TCP_CA_Open = 0, | 136 | TCP_CA_Open = 0, |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index b7c2f439b54f..197c0008503c 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -2764,6 +2764,8 @@ void tcp_get_info(const struct sock *sk, struct tcp_info *info) | |||
2764 | info->tcpi_options |= TCPI_OPT_ECN; | 2764 | info->tcpi_options |= TCPI_OPT_ECN; |
2765 | if (tp->ecn_flags & TCP_ECN_SEEN) | 2765 | if (tp->ecn_flags & TCP_ECN_SEEN) |
2766 | info->tcpi_options |= TCPI_OPT_ECN_SEEN; | 2766 | info->tcpi_options |= TCPI_OPT_ECN_SEEN; |
2767 | if (tp->syn_data_acked) | ||
2768 | info->tcpi_options |= TCPI_OPT_SYN_DATA; | ||
2767 | 2769 | ||
2768 | info->tcpi_rto = jiffies_to_usecs(icsk->icsk_rto); | 2770 | info->tcpi_rto = jiffies_to_usecs(icsk->icsk_rto); |
2769 | info->tcpi_ato = jiffies_to_usecs(icsk->icsk_ack.ato); | 2771 | info->tcpi_ato = jiffies_to_usecs(icsk->icsk_ack.ato); |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 432c36649db3..036f85738141 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -5646,6 +5646,7 @@ static bool tcp_rcv_fastopen_synack(struct sock *sk, struct sk_buff *synack, | |||
5646 | tcp_rearm_rto(sk); | 5646 | tcp_rearm_rto(sk); |
5647 | return true; | 5647 | return true; |
5648 | } | 5648 | } |
5649 | tp->syn_data_acked = tp->syn_data; | ||
5649 | return false; | 5650 | return false; |
5650 | } | 5651 | } |
5651 | 5652 | ||
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index ef998b008a57..0c4a64355603 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -1461,6 +1461,7 @@ static int tcp_v4_conn_req_fastopen(struct sock *sk, | |||
1461 | skb_set_owner_r(skb, child); | 1461 | skb_set_owner_r(skb, child); |
1462 | __skb_queue_tail(&child->sk_receive_queue, skb); | 1462 | __skb_queue_tail(&child->sk_receive_queue, skb); |
1463 | tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq; | 1463 | tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq; |
1464 | tp->syn_data_acked = 1; | ||
1464 | } | 1465 | } |
1465 | sk->sk_data_ready(sk, 0); | 1466 | sk->sk_data_ready(sk, 0); |
1466 | bh_unlock_sock(child); | 1467 | bh_unlock_sock(child); |
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 27536ba16c9d..a7302d974f32 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c | |||
@@ -510,6 +510,7 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req, | |||
510 | newtp->rx_opt.mss_clamp = req->mss; | 510 | newtp->rx_opt.mss_clamp = req->mss; |
511 | TCP_ECN_openreq_child(newtp, req); | 511 | TCP_ECN_openreq_child(newtp, req); |
512 | newtp->fastopen_rsk = NULL; | 512 | newtp->fastopen_rsk = NULL; |
513 | newtp->syn_data_acked = 0; | ||
513 | 514 | ||
514 | TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_PASSIVEOPENS); | 515 | TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_PASSIVEOPENS); |
515 | } | 516 | } |