]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
net-tcp: Fast Open client - sending SYN-data
authorYuchung Cheng <ycheng@google.com>
Thu, 19 Jul 2012 06:43:07 +0000 (06:43 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 19 Jul 2012 18:02:03 +0000 (11:02 -0700)
commit783237e8daf13481ee234997cbbbb823872ac388
treecf6e9adf54eedbc155d4fc43bcf6ec87aaac820e
parent1fe4c481ba637660793217769695c146a037bd54
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>
include/linux/snmp.h
include/linux/tcp.h
include/net/tcp.h
net/ipv4/af_inet.c
net/ipv4/proc.c
net/ipv4/tcp_output.c