Content-Type: multipart/mixed; boundary="===============7295499823533568327==" MIME-Version: 1.0 From: Mat Martineau To: mptcp at lists.01.org Subject: [MPTCP] [PATCH mptcp-next v3 02/12] mptcp: Return EPIPE if sending is shut down during a sendmsg Date: Thu, 23 Jul 2020 10:43:06 -0700 Message-ID: <20200723174316.131049-3-mathew.j.martineau@linux.intel.com> In-Reply-To: 20200723174316.131049-1-mathew.j.martineau@linux.intel.com X-Status: X-Keywords: X-UID: 5260 --===============7295499823533568327== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable A MPTCP socket where sending has been shut down should not attempt to send additional data, since DATA_FIN has already been sent. Signed-off-by: Mat Martineau --- net/mptcp/protocol.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 56cb47439ca3..9e812011c635 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -748,6 +748,11 @@ static int mptcp_sendmsg(struct sock *sk, struct msghd= r *msg, size_t len) restart: mptcp_clean_una(sk); = + if (sk->sk_err || (sk->sk_shutdown & SEND_SHUTDOWN)) { + ret =3D -EPIPE; + goto out; + } + wait_for_sndbuf: __mptcp_flush_join_list(msk); ssk =3D mptcp_subflow_get_send(msk); -- = 2.27.0 --===============7295499823533568327==--