Skip to content

Commit

Permalink
mptcp: add MSG_FASTOPEN sendmsg flag support
Browse files Browse the repository at this point in the history
Since commit 54f1944 ("mptcp: factor out mptcp_connect()"), all the
infrastructure is now in place to support the MSG_FASTOPEN flag, we
just need to call into the fastopen path in mptcp_sendmsg().

Co-developed-by: Benjamin Hesmans <benjamin.hesmans@tessares.net>
Signed-off-by: Benjamin Hesmans <benjamin.hesmans@tessares.net>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Dmytro Shytyi <dmytro@shytyi.net>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Dmytro Shytyi authored and kuba-moo committed Nov 30, 2022
1 parent f2bb566 commit 1e777f3
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions net/mptcp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -1711,17 +1711,14 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
int ret = 0;
long timeo;

/* we don't support FASTOPEN yet */
if (msg->msg_flags & MSG_FASTOPEN)
return -EOPNOTSUPP;

/* silently ignore everything else */
msg->msg_flags &= MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL;
msg->msg_flags &= MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL | MSG_FASTOPEN;

lock_sock(sk);

ssock = __mptcp_nmpc_socket(msk);
if (unlikely(ssock && inet_sk(ssock->sk)->defer_connect)) {
if (unlikely(ssock && (inet_sk(ssock->sk)->defer_connect ||
msg->msg_flags & MSG_FASTOPEN))) {
int copied_syn = 0;

ret = mptcp_sendmsg_fastopen(sk, ssock->sk, msg, len, &copied_syn);
Expand Down

0 comments on commit 1e777f3

Please sign in to comment.