aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorYuchung Cheng <ycheng@google.com>2012-07-19 02:43:07 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-19 14:02:03 -0400
commit783237e8daf13481ee234997cbbbb823872ac388 (patch)
treecf6e9adf54eedbc155d4fc43bcf6ec87aaac820e /include/net
parent1fe4c481ba637660793217769695c146a037bd54 (diff)
net-tcp: Fast Open client - sending SYN-data
This patch implements sending SYN-data in tcp_connect(). The data is from tcp_sendmsg() with flag MSG_FASTOPEN (implemented in a later patch). The length of the cookie in tcp_fastopen_req, init'd to 0, controls the type of the SYN. If the cookie is not cached (len==0), the host sends data-less SYN with Fast Open cookie request option to solicit a cookie from the remote. If cookie is not available (len > 0), the host sends a SYN-data with Fast Open cookie option. If cookie length is negative, the SYN will not include any Fast Open option (for fall back operations). To deal with middleboxes that may drop SYN with data or experimental TCP option, the SYN-data is only sent once. SYN retransmits do not include data or Fast Open options. The connection will fall back to regular TCP handshake. Signed-off-by: Yuchung Cheng <ycheng@google.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/tcp.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index e601da197361..867557b4244a 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1289,6 +1289,15 @@ extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, const struct sk_buff
1289extern int tcp_md5_hash_key(struct tcp_md5sig_pool *hp, 1289extern int tcp_md5_hash_key(struct tcp_md5sig_pool *hp,
1290 const struct tcp_md5sig_key *key); 1290 const struct tcp_md5sig_key *key);
1291 1291
1292struct tcp_fastopen_request {
1293 /* Fast Open cookie. Size 0 means a cookie request */
1294 struct tcp_fastopen_cookie cookie;
1295 struct msghdr *data; /* data in MSG_FASTOPEN */
1296 u16 copied; /* queued in tcp_connect() */
1297};
1298
1299void tcp_free_fastopen_req(struct tcp_sock *tp);
1300
1292/* write queue abstraction */ 1301/* write queue abstraction */
1293static inline void tcp_write_queue_purge(struct sock *sk) 1302static inline void tcp_write_queue_purge(struct sock *sk)
1294{ 1303{