From: Wei Wang <weiwan@google.com>
To: linux-man@vger.kernel.org,
Alejandro Colomar <alx.manpages@gmail.com>,
Michael Kerrisk <mtk.manpages@gmail.com>
Cc: netdev@vger.kernel.org, Yuchung Cheng <ycheng@google.com>,
Eric Dumazet <edumazet@google.com>
Subject: [patch v2] send.2: Add MSG_FASTOPEN flag
Date: Thu, 16 Sep 2021 21:16:06 -0700 [thread overview]
Message-ID: <20210917041606.167192-1-weiwan@google.com> (raw)
MSG_FASTOPEN flag is available since Linux 3.7. Add detailed description
in the manpage according to RFC7413.
Signed-off-by: Wei Wang <weiwan@google.com>
Reviewed-by: Yuchung Cheng <ycheng@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
---
Change in v2: corrected some format issues
man2/send.2 | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/man2/send.2 b/man2/send.2
index fd28fed90..acaa05be9 100644
--- a/man2/send.2
+++ b/man2/send.2
@@ -252,6 +252,38 @@ data on sockets that support this notion (e.g., of type
the underlying protocol must also support
.I out-of-band
data.
+.TP
+.BR MSG_FASTOPEN " (since Linux 3.7)"
+Attempts TCP Fast Open (RFC7413) and sends data in the SYN like a
+combination of
+.BR connect (2)
+and
+.BR write (2),
+by performing an implicit
+.BR connect (2)
+operation.
+It blocks until the data is buffered and the handshake has completed.
+For a non-blocking socket,
+it returns the number of bytes buffered and sent in the SYN packet.
+If the cookie is not available locally,
+it returns
+.BR EINPROGRESS ,
+and sends a SYN with a Fast Open cookie request automatically.
+The caller needs to write the data again when the socket is connected.
+On errors,
+it sets the same
+.I errno
+as
+.BR connect (2)
+if the handshake fails.
+This flag requires enabling TCP Fast Open client support on sysctl
+.IR net.ipv4.tcp_fastopen .
+.IP
+Refer to
+.B TCP_FASTOPEN_CONNECT
+socket option in
+.BR tcp (7)
+for an alternative approach.
.SS sendmsg()
The definition of the
.I msghdr
--
2.33.0.464.g1972c5931b-goog
next reply other threads:[~2021-09-17 4:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-17 4:16 Wei Wang [this message]
2021-09-20 19:24 ` [patch v2] send.2: Add MSG_FASTOPEN flag Alejandro Colomar (man-pages)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210917041606.167192-1-weiwan@google.com \
--to=weiwan@google.com \
--cc=alx.manpages@gmail.com \
--cc=edumazet@google.com \
--cc=linux-man@vger.kernel.org \
--cc=mtk.manpages@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=ycheng@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).