diff options
author | Yuchung Cheng <ycheng@google.com> | 2012-07-19 02:43:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-19 14:02:03 -0400 |
commit | 783237e8daf13481ee234997cbbbb823872ac388 (patch) | |
tree | cf6e9adf54eedbc155d4fc43bcf6ec87aaac820e /include/linux/tcp.h | |
parent | 1fe4c481ba637660793217769695c146a037bd54 (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/linux/tcp.h')
-rw-r--r-- | include/linux/tcp.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 12948f543839..1edf96afab44 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -386,7 +386,8 @@ struct tcp_sock { | |||
386 | unused : 1; | 386 | unused : 1; |
387 | u8 repair_queue; | 387 | u8 repair_queue; |
388 | u8 do_early_retrans:1,/* Enable RFC5827 early-retransmit */ | 388 | u8 do_early_retrans:1,/* Enable RFC5827 early-retransmit */ |
389 | early_retrans_delayed:1; /* Delayed ER timer installed */ | 389 | early_retrans_delayed:1, /* Delayed ER timer installed */ |
390 | syn_fastopen:1; /* SYN includes Fast Open option */ | ||
390 | 391 | ||
391 | /* RTT measurement */ | 392 | /* RTT measurement */ |
392 | u32 srtt; /* smoothed round trip time << 3 */ | 393 | u32 srtt; /* smoothed round trip time << 3 */ |
@@ -500,6 +501,9 @@ struct tcp_sock { | |||
500 | struct tcp_md5sig_info __rcu *md5sig_info; | 501 | struct tcp_md5sig_info __rcu *md5sig_info; |
501 | #endif | 502 | #endif |
502 | 503 | ||
504 | /* TCP fastopen related information */ | ||
505 | struct tcp_fastopen_request *fastopen_req; | ||
506 | |||
503 | /* When the cookie options are generated and exchanged, then this | 507 | /* When the cookie options are generated and exchanged, then this |
504 | * object holds a reference to them (cookie_values->kref). Also | 508 | * object holds a reference to them (cookie_values->kref). Also |
505 | * contains related tcp_cookie_transactions fields. | 509 | * contains related tcp_cookie_transactions fields. |