aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/tcp.h
diff options
context:
space:
mode:
authorYuchung Cheng <ycheng@google.com>2014-05-11 23:22:11 -0400
committerDavid S. Miller <davem@davemloft.net>2014-05-13 17:53:02 -0400
commit843f4a55e336e6d0c7bb92e7f9621535bc8d5fcd (patch)
tree17010fcb1b56174476b471758c3ca4f825ccbe7f /include/net/tcp.h
parent89278c9dc922272df921042aafa18311f3398c6c (diff)
tcp: use tcp_v4_send_synack on first SYN-ACK
To avoid large code duplication in IPv6, we need to first simplify the complicate SYN-ACK sending code in tcp_v4_conn_request(). To use tcp_v4(6)_send_synack() to send all SYN-ACKs, we need to initialize the mini socket's receive window before trying to create the child socket and/or building the SYN-ACK packet. So we move that initialization from tcp_make_synack() to tcp_v4_conn_request() as a new function tcp_openreq_init_req_rwin(). After this refactoring the SYN-ACK sending code is simpler and easier to implement Fast Open for IPv6. Signed-off-by: Yuchung Cheng <ycheng@google.com> Signed-off-by: Daniel Lee <longinus00@gmail.com> Signed-off-by: Jerry Chu <hkchu@google.com> Acked-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r--include/net/tcp.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 17d7c6a3d037..f5d6ca4a9d28 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1114,6 +1114,9 @@ static inline void tcp_openreq_init(struct request_sock *req,
1114 ireq->ir_num = ntohs(tcp_hdr(skb)->dest); 1114 ireq->ir_num = ntohs(tcp_hdr(skb)->dest);
1115} 1115}
1116 1116
1117extern void tcp_openreq_init_rwin(struct request_sock *req,
1118 struct sock *sk, struct dst_entry *dst);
1119
1117void tcp_enter_memory_pressure(struct sock *sk); 1120void tcp_enter_memory_pressure(struct sock *sk);
1118 1121
1119static inline int keepalive_intvl_when(const struct tcp_sock *tp) 1122static inline int keepalive_intvl_when(const struct tcp_sock *tp)
@@ -1323,13 +1326,10 @@ void tcp_free_fastopen_req(struct tcp_sock *tp);
1323 1326
1324extern struct tcp_fastopen_context __rcu *tcp_fastopen_ctx; 1327extern struct tcp_fastopen_context __rcu *tcp_fastopen_ctx;
1325int tcp_fastopen_reset_cipher(void *key, unsigned int len); 1328int tcp_fastopen_reset_cipher(void *key, unsigned int len);
1326int tcp_fastopen_create_child(struct sock *sk, 1329bool tcp_try_fastopen(struct sock *sk, struct sk_buff *skb,
1327 struct sk_buff *skb, 1330 struct request_sock *req,
1328 struct sk_buff *skb_synack, 1331 struct tcp_fastopen_cookie *foc,
1329 struct request_sock *req); 1332 struct dst_entry *dst);
1330bool tcp_fastopen_check(struct sock *sk, struct sk_buff *skb,
1331 struct request_sock *req,
1332 struct tcp_fastopen_cookie *foc);
1333void tcp_fastopen_init_key_once(bool publish); 1333void tcp_fastopen_init_key_once(bool publish);
1334#define TCP_FASTOPEN_KEY_LENGTH 16 1334#define TCP_FASTOPEN_KEY_LENGTH 16
1335 1335