]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mptcp: fix warn at shutdown time for unaccepted msk sockets
authorPaolo Abeni <pabeni@redhat.com>
Fri, 7 Aug 2020 17:03:53 +0000 (19:03 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 8 Aug 2020 00:26:16 +0000 (17:26 -0700)
With commit 084e8b62d5f1 ("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/66
Reported-and-tested-by: Christoph Paasch <cpaasch@apple.com>
Fixes: 084e8b62d5f1 ("mptcp: explicitly track the fully established status")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mptcp/subflow.c

index 96f4f2fe50aded97f768c6f8e8d81f8717f24a80..e8cac2655c827b76ee5327d6a0f44fac6a9f45c7 100644 (file)
@@ -423,12 +423,12 @@ static void mptcp_sock_destruct(struct sock *sk)
         * also remove the mptcp socket, via
         * sock_put(ctx->conn).
         *
-        * Problem is that the mptcp socket will not be in
-        * SYN_RECV state and doesn't have SOCK_DEAD flag.
+        * Problem is that the mptcp socket will be in
+        * ESTABLISHED state and will not have the SOCK_DEAD flag.
         * 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;
                WARN_ON_ONCE(sk->sk_socket);
                sock_orphan(sk);