Skip to content

Commit 57baaf2

Browse files
mjmartineaudavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0bac966 commit 57baaf2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

net/mptcp/protocol.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,11 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
748748
restart:
749749
mptcp_clean_una(sk);
750750

751+
if (sk->sk_err || (sk->sk_shutdown & SEND_SHUTDOWN)) {
752+
ret = -EPIPE;
753+
goto out;
754+
}
755+
751756
wait_for_sndbuf:
752757
__mptcp_flush_join_list(msk);
753758
ssk = mptcp_subflow_get_send(msk);

0 commit comments

Comments
 (0)