Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp423779lqo; Fri, 10 May 2024 04:19:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWP12/h3A4aWJNE1g4rBZGauMKXTXvT3ysgTccf/Us+2jMVrASOgk/T+hBAzZJ+hGSf4ofgcTJXbLD9qlfjzcyMU8DwFVg81CWpUQpFfQ== X-Google-Smtp-Source: AGHT+IERUE5RltnM/6f+oLwytOAKeIJr+ma6vDArZELEcfzLuugNNBMuiIC6GE3cp6P+/EdTgBgd X-Received: by 2002:a17:902:b282:b0:1dd:2eed:52a5 with SMTP id d9443c01a7336-1ef43f3b868mr20827335ad.37.1715339966246; Fri, 10 May 2024 04:19:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715339966; cv=pass; d=google.com; s=arc-20160816; b=z0o+aBY5tX+oRv8cwalg1oqYZHS0pur07+PDnOJkqXdcfS440ZzSCZoG/bCkBgdfF0 J9rvRTWmJ9VqpqVZqL17/TVD0NgVibUneprC8HHKYaMAa8za/JTHgjaOyvJZBuSS8kEl Kr5609vmF9od4ZKaeGSu3j01ttNkcQPVEs7D2klkNX+9tmkp4orqmCmgyD0WmIkBR3oT KCN63fGLhHNEny8yuHPiEge43ylY5C31nYn2XMv+07CNAohPvNnxNyDsMw5tYLo3eqb1 SQctADrLbRNzLbD5WnBGiQ1WnBOQmMbMFCQe7Nr1+SICg4N62f2JG0SrVYEjAtaWuAR/ EKEQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=vi/w5P4eaWcV5bb37q2N+3q/I6BotmaXWQSsfC2EiuU=; fh=quEeNqdtSTihk0Sjr9Tsd/2OdzTTR5adQM8Csz/bJ2A=; b=QLHE7I2W3qj37VLzF5HGIiCOQ3gzt0fZra0YmDF39rB9l0teIJCTg8B1eUWWdWUW8R Lup7GQL4MRr9fNSSr9p41Srk6QsjsF4J8Wq1jbeyzwu4uVtJOb6DPvjoWVP1A3GUUCdL hTecARTkDYxrcRAJswlC4j3kjXRv5Za4bMEbTCUMcGPDhAVl+a/gjahzo9ooHGPyqEcw gNFkQe73vxnX3/f7Bv/2gujUOcEZ/XoC5PC3Z6C84YRBhWyLVfQCWeu1f8GYIZetjWKn hO/8SPo+2TbZ+2adsoTilMaphM2Cr8XLTBwkh9SdVvFH2bOkeb+EA89wpc2GmnAFOyJS l34g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Pwy4GnLC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-175637-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175637-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0b9cfbbdsi35377385ad.24.2024.05.10.04.19.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 04:19:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-175637-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Pwy4GnLC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-175637-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175637-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 6D3B1B20BB8 for ; Fri, 10 May 2024 11:19:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B59DF16F288; Fri, 10 May 2024 11:18:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Pwy4GnLC" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D483B16F0DA; Fri, 10 May 2024 11:18:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715339938; cv=none; b=pFPPc1yy4xueEZFDDQ2DXP0Lk2Mk+9YcHzSG89BQRqLb9NH6UbqdUx/0uT/Vh8+Xi44Xu4n4dhQawe7xdUQHzV3MOqQ9Hc1j3Spf/y7sit+kGfW9PqrBvOAwOyw5SsOAROHSScaE5wAgTrR4Bbn1fdLwTaWGFWQBUmhpBcoheLQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715339938; c=relaxed/simple; bh=e72oNWyYzu0S4cUwcbJkoVMrT7hFjweEktpyclaET6I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rHsY9kcGUD3SrKibe20AfFdITxxKfnul1qykkeXGtiLA1TpZFVC8Bqpv/qPruoLE+YIfFt7Va9+x8k8SIJj12ixspNFxc9ecXG8ah9YEvmAGtt5hnBIwbElkCBC091fvJbcAbkZQIbkk+EuVcW8A8+w7n3UeRlKN3OY7RTMDITI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Pwy4GnLC; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12729C113CC; Fri, 10 May 2024 11:18:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715339938; bh=e72oNWyYzu0S4cUwcbJkoVMrT7hFjweEktpyclaET6I=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Pwy4GnLC0r5k93j8vZc6EL/Ule56xU/cdUIsmZtzRraInzpI150pNndl0L4n9+Xf0 SbPADg/GPvU9MbRhelCo2yTjNJJd38P+eWSKMd70iOw72ilNA6a/ya/Bp0oAz2qoRf N1hVRUc2zTdfFM8jjmBc+sW9Wg3GIJVuog/ORsOvQC/NCnnvbYj4OHyBmM36kSjNFb O8KoMSWJKH8DaxiyqzHYZquPqcrLhgWlROGv5dRH5+Ywy3oClvPj2CCWb0uBTi56iG PCmb9RK+o/F8Pnmfwu9YIf3OnmakWsbTIRG9SRXxjvqQnPpsoGAXZEXg6is5ogoGkq n0xlsO3Mo5frg== From: "Matthieu Baerts (NGI0)" Date: Fri, 10 May 2024 13:18:31 +0200 Subject: [PATCH net-next 1/8] mptcp: SO_KEEPALIVE: fix getsockopt support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240510-upstream-net-next-20240509-misc-improvements-v1-1-4f25579e62ba@kernel.org> References: <20240510-upstream-net-next-20240509-misc-improvements-v1-0-4f25579e62ba@kernel.org> In-Reply-To: <20240510-upstream-net-next-20240509-misc-improvements-v1-0-4f25579e62ba@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Florian Westphal Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Matthieu Baerts (NGI0)" X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1498; i=matttbe@kernel.org; h=from:subject:message-id; bh=e72oNWyYzu0S4cUwcbJkoVMrT7hFjweEktpyclaET6I=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmPgKcli09G1VxtjxaHvlHQu1/+J+WFb8w/44+s UZ6ZsWjT9WJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZj4CnAAKCRD2t4JPQmmg c3rUEACh1Bs3IPBnK6zn8d3s27ZT8sreHxXUt+ZCmGxBhEcxASY6vCXT02Pn/kccYEgE1Bb3esa 9fDnx8Yj4QhM7AEks4QJQOU3pV8b//X1HrfNlFRdWlRO5zvCcxzM+cE9xAQw2b0Mdf+2aT36cg9 x6eGDWVaYSEQyWvUUlhPitSbX5E++Qsx+mtPkHEeTXUwDVQQwQ2y4pZMX5Q9W/p16fJ/oS7ZO8A S1gyK1Gl1DZYJ8tXzWw7BSm51Xa5XvZuNKfeXZg6EdUWps9j+LmP7iTueDL5Ef8pq9t0p0fsSYS g6ZDvUHhjgMEtIVqHv6JqmZxnW9FyGeYsMHtB2V78NmYkQZFbQR2TlO4UejugheE/jzwKAaLwpk XSIvrDzfLSGKmythuSmw8IPu6Zt7fhlMnv1KS2RrntH9ILnDywCxN++UlLMqK+76+zsKmHKKPaf W4cq+onNNG2ouTSJQSfxx7Z663nZYbp7mXCh7rVNEvFU/2CFzXBkZDl1ggoDmwyNiDjge9WHD5Y BtL37jEtkHtXshZgcUzFF4N5TN9ryxwRk8pggJj/OFpfkQ37j/cs3hTpc41n0jj7ALyhquh/OOp 2vqhyYbOz8U6X365izSKma4KsRP7rv3eP9g2QBHR182ueQgQ4EBxlnVhCQRcD13Wi/w3YN+A9P3 Gxii9efmB/ubzHQ== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 SO_KEEPALIVE support has to be set on each subflow: on each TCP socket, where sk_prot->keepalive is defined. Technically, nothing has to be done on the MPTCP socket. That's why mptcp_sol_socket_sync_intval() was called instead of mptcp_sol_socket_intval(). Except that when nothing is done on the MPTCP socket, the getsockopt(SO_KEEPALIVE), handled in net/core/sock.c:sk_getsockopt(), will not know if SO_KEEPALIVE has been set on the different subflows or not. The fix is simple: simply call mptcp_sol_socket_intval() which will end up calling net/core/sock.c:sk_setsockopt() where the SOCK_KEEPOPEN flag will be set, the one used in sk_getsockopt(). So now, getsockopt(SO_KEEPALIVE) on an MPTCP socket will return the same value as the one previously set with setsockopt(SO_KEEPALIVE). Fixes: 1b3e7ede1365 ("mptcp: setsockopt: handle SO_KEEPALIVE and SO_PRIORITY") Acked-by: Paolo Abeni Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/sockopt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c index 1fea43f5b6f3..69fc584fc57e 100644 --- a/net/mptcp/sockopt.c +++ b/net/mptcp/sockopt.c @@ -181,8 +181,6 @@ static int mptcp_setsockopt_sol_socket_int(struct mptcp_sock *msk, int optname, switch (optname) { case SO_KEEPALIVE: - mptcp_sol_socket_sync_intval(msk, optname, val); - return 0; case SO_DEBUG: case SO_MARK: case SO_PRIORITY: -- 2.43.0