]> git.baikalelectronics.ru Git - kernel.git/commit
net-tcp: Fast Open client - sendmsg(MSG_FASTOPEN)
authorYuchung Cheng <ycheng@google.com>
Thu, 19 Jul 2012 06:43:09 +0000 (06:43 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 19 Jul 2012 18:02:03 +0000 (11:02 -0700)
commit4bf0c7f07ce59cc9b28d9a8e8caa56f6937298f2
tree478ee362f10d0737fbc4e6642e2966abe0cd1397
parent388d5583973f7aa01a7a105ecbb0c6f47e9c6e0e
net-tcp: Fast Open client - sendmsg(MSG_FASTOPEN)

sendmsg() (or sendto()) with MSG_FASTOPEN is a combo of connect(2)
and write(2). The application should replace connect() with it to
send data in the opening SYN packet.

For blocking socket, sendmsg() blocks until all the data are buffered
locally and the handshake is completed like connect() call. It
returns similar errno like connect() if the TCP handshake fails.

For non-blocking socket, it returns the number of bytes queued (and
transmitted in the SYN-data packet) if cookie is available. If cookie
is not available, it transmits a data-less SYN packet with Fast Open
cookie request option and returns -EINPROGRESS like connect().

Using MSG_FASTOPEN on connecting or connected socket will result in
simlar errno like repeating connect() calls. Therefore the application
should only use this flag on new sockets.

The buffer size of sendmsg() is independent of the MSS of the connection.

Signed-off-by: Yuchung Cheng <ycheng@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/networking/ip-sysctl.txt
include/linux/socket.h
include/net/inet_common.h
include/net/tcp.h
net/ipv4/af_inet.c
net/ipv4/tcp.c
net/ipv4/tcp_ipv4.c