Skip to content

Commit 7ee2492

Browse files
Paolo Abenidavem330
authored andcommitted
mptcp: fix warn at shutdown time for unaccepted msk sockets
With commit b93df08 ("mptcp: explicitly track the fully established status"), the status of unaccepted mptcp closed in mptcp_sock_destruct() changes from TCP_SYN_RECV to TCP_ESTABLISHED. As a result mptcp_sock_destruct() does not perform the proper cleanup and inet_sock_destruct() will later emit a warn. Address the issue updating the condition tested in mptcp_sock_destruct(). Also update the related comment. Closes: multipath-tcp/mptcp_net-next#66 Reported-and-tested-by: Christoph Paasch <[email protected]> Fixes: b93df08 ("mptcp: explicitly track the fully established status") Signed-off-by: Paolo Abeni <[email protected]> Reviewed-by: Matthieu Baerts <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6bdb621 commit 7ee2492

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

net/mptcp/subflow.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,12 +423,12 @@ static void mptcp_sock_destruct(struct sock *sk)
423423
* also remove the mptcp socket, via
424424
* sock_put(ctx->conn).
425425
*
426-
* Problem is that the mptcp socket will not be in
427-
* SYN_RECV state and doesn't have SOCK_DEAD flag.
426+
* Problem is that the mptcp socket will be in
427+
* ESTABLISHED state and will not have the SOCK_DEAD flag.
428428
* Both result in warnings from inet_sock_destruct.
429429
*/
430430

431-
if (sk->sk_state == TCP_SYN_RECV) {
431+
if (sk->sk_state == TCP_ESTABLISHED) {
432432
sk->sk_state = TCP_CLOSE;
433433
WARN_ON_ONCE(sk->sk_socket);
434434
sock_orphan(sk);

0 commit comments

Comments
 (0)