diff mbox series

[net] mptcp: fix warn at shutdown time for unaccepted msk sockets

Message ID 1a4636f016e3e8b7949380b5f4ab4e77ae3c316d.1596817055.git.pabeni@redhat.com
State Accepted, archived
Delegated to: Matthieu Baerts
Headers show
Series [net] mptcp: fix warn at shutdown time for unaccepted msk sockets | expand

Commit Message

Paolo Abeni Aug. 7, 2020, 4:17 p.m. UTC
With commit b93df08ccda3 ("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
in ESTABLISHED status.

Address the issue updating the condition tested in mptcp_sock_destruct().
Also update the related comment.

Fixes: b93df08ccda3 ("mptcp: explicitly track the fully established status")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
 net/mptcp/subflow.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Christoph Paasch Aug. 7, 2020, 4:36 p.m. UTC | #1
On 08/07/20 - 18:17, Paolo Abeni wrote:
> With commit b93df08ccda3 ("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
> in ESTABLISHED status.
> 
> Address the issue updating the condition tested in mptcp_sock_destruct().
> Also update the related comment.
> 
> Fixes: b93df08ccda3 ("mptcp: explicitly track the fully established status")
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> ---
>  net/mptcp/subflow.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Tested-by: Christoph Paasch <cpaasch@apple.com>



Christoph
diff mbox series

Patch

diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 45c2284f6ada..3c2ca2108ac2 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -424,12 +424,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);