aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMat Martineau2020-07-28 15:12:00 -0700
committerDavid S. Miller2020-07-28 17:02:41 -0700
commit57baaf2875404b555587391608da1625863086fa (patch)
treec3e53379430b46a00916652aabd22bee8fd78e04
parent0bac966a1f2ae0e3cbc259c5bb10aab7bbcf8f4b (diff)
mptcp: Return EPIPE if sending is shut down during a sendmsg
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 <mathew.j.martineau@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/mptcp/protocol.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 2891ae8a1028..b3c3dbc89b3f 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -748,6 +748,11 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
restart:
mptcp_clean_una(sk);
+ if (sk->sk_err || (sk->sk_shutdown & SEND_SHUTDOWN)) {
+ ret = -EPIPE;
+ goto out;
+ }
+
wait_for_sndbuf:
__mptcp_flush_join_list(msk);
ssk = mptcp_subflow_get_send(msk);