Commit 7ee24926 authored by Paolo Abeni's avatar Paolo Abeni Committed by David S. Miller

mptcp: fix warn at shutdown time for unaccepted msk sockets

With commit b93df08c ("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: https://github.com/multipath-tcp/mptcp_net-next/issues/66Reported-and-tested-by: default avatarChristoph Paasch <cpaasch@apple.com>
Fixes: b93df08c ("mptcp: explicitly track the fully established status")
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
Reviewed-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6bdb6211
...@@ -423,12 +423,12 @@ static void mptcp_sock_destruct(struct sock *sk) ...@@ -423,12 +423,12 @@ static void mptcp_sock_destruct(struct sock *sk)
* also remove the mptcp socket, via * also remove the mptcp socket, via
* sock_put(ctx->conn). * sock_put(ctx->conn).
* *
* Problem is that the mptcp socket will not be in * Problem is that the mptcp socket will be in
* SYN_RECV state and doesn't have SOCK_DEAD flag. * ESTABLISHED state and will not have the SOCK_DEAD flag.
* Both result in warnings from inet_sock_destruct. * Both result in warnings from inet_sock_destruct.
*/ */
if (sk->sk_state == TCP_SYN_RECV) { if (sk->sk_state == TCP_ESTABLISHED) {
sk->sk_state = TCP_CLOSE; sk->sk_state = TCP_CLOSE;
WARN_ON_ONCE(sk->sk_socket); WARN_ON_ONCE(sk->sk_socket);
sock_orphan(sk); sock_orphan(sk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment