From patchwork Thu Oct 15 14:30:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Davide Caratti X-Patchwork-Id: 1382705 X-Patchwork-Delegate: matthieu.baerts@tessares.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.01.org (client-ip=2001:19d0:306:5::1; helo=ml01.01.org; envelope-from=mptcp-bounces@lists.01.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=XWEdIIK3; dkim-atps=neutral Received: from ml01.01.org (ml01.01.org [IPv6:2001:19d0:306:5::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CBsBt0h2xz9sRR for ; Fri, 16 Oct 2020 01:30:29 +1100 (AEDT) Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E16BF1585E0D9; Thu, 15 Oct 2020 07:30:26 -0700 (PDT) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=63.128.21.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=dcaratti@redhat.com; receiver= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C74E51585E0D6 for ; Thu, 15 Oct 2020 07:30:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602772222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IVXAvqyYSeGiMqnPXa1joPUdQFvrrbB/ekluSLYXPZM=; b=XWEdIIK3F9QI3qoFi4l/nT8pYXV4lSBfGShHhbXyrFeC5PmRr2h2X3mzBy0rC5ogAXZykb ofNHLPcWU8gbcAbii2WWgvJl7MJOepALi4Zdx8j4DASkXg6+nUaV+KCNZ1L9K1qBG3WuTU 2h430XaIfn/xQz1OV0U6kqz3zRLRsNk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-282-wiqnHPC_NoWppTsNltqSpw-1; Thu, 15 Oct 2020 10:30:19 -0400 X-MC-Unique: wiqnHPC_NoWppTsNltqSpw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4574B18A0763 for ; Thu, 15 Oct 2020 14:30:18 +0000 (UTC) Received: from new-host-6.redhat.com (unknown [10.40.193.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id AC83D672C0 for ; Thu, 15 Oct 2020 14:30:17 +0000 (UTC) From: Davide Caratti To: mptcp@lists.01.org Date: Thu, 15 Oct 2020 16:30:15 +0200 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dcaratti@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: UUA7KMI6BJ5JMVZNJOATB47JJ7Y5A7RY X-Message-ID-Hash: UUA7KMI6BJ5JMVZNJOATB47JJ7Y5A7RY X-MailFrom: dcaratti@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.1.1 Precedence: list Subject: [MPTCP] [PATCH net-next] Squash-to: "mptcp: refactor shutdown and close" List-Id: Discussions regarding MPTCP upstreaming Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: when the data-fin is acked on all subflows, the socket goes in FIN_WAIT_2 state. Call __mptcp_destroy_sock() to transmit a TCP FIN. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/98 Signed-off-by: Davide Caratti --- net/mptcp/protocol.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 5b32741f2af3..95566f120e72 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -1859,7 +1859,8 @@ static void mptcp_worker(struct work_struct *work) */ if (sock_flag(sk, SOCK_DEAD) && (mptcp_check_close_timeout(sk) || - (state != sk->sk_state && sk->sk_state == TCP_CLOSE))) { + (state != sk->sk_state && + ((1 << inet_sk_state_load(sk)) & (TCPF_CLOSE | TCPF_FIN_WAIT2))))) { inet_sk_state_store(sk, TCP_CLOSE); __mptcp_destroy_sock(sk, 0); goto unlock;