From patchwork Fri May 10 11:18:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13661346 X-Patchwork-Delegate: kuba@kernel.org 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Pwy4GnLC" 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: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 X-Patchwork-Delegate: kuba@kernel.org 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: From patchwork Fri May 10 11:18:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13661347 X-Patchwork-Delegate: kuba@kernel.org 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 72DE316F84A; Fri, 10 May 2024 11:19:01 +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=1715339941; cv=none; b=ieY/Hr+iKdFUe5Nz41smoYb9faTgCdalCOm8qw01Erob6jml4+2r9VnFe+Mpp/dgSFifq+r3LDzFoM2akPmbHLP98XRiMM5/z5vT/YtxE0bUm0HWMaaOmC9c0vkF5EbylGxnfESjJPD6NH7lGPpK4Wf7OrhE+uFJZZ9gAdZt6zQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715339941; c=relaxed/simple; bh=gx0qqngzRCb+X3NtTvf6ue9ZR5QeWwvf6CM1qbMEY0Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PzYQzjpNsmtZEMRdLsVufcPYtIjvXHlryfRyJ5zerEsMXphHQIO8/cDg63UaIdduESvb+foO4KA44NsZzj6HNK/y1jSwL5MBN5MS1WXO1fICC7+UMOLbe25jQoByPC9BaTEFM0CBPJV6WqeQ9gUvqs1zUcwG+t3+gohADGVIwco= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BlwjDlj5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BlwjDlj5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C990BC32782; Fri, 10 May 2024 11:18:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715339941; bh=gx0qqngzRCb+X3NtTvf6ue9ZR5QeWwvf6CM1qbMEY0Q=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=BlwjDlj5ydEfEtgpMuQ0zKPg8vS3jGRtZiXFy/sBwZyFiStJ9FOldjUmK2+61bWE9 2EJ1EDdfIIuhsLWHdHLH7EFS+7TI9aStB7rykzinR9ZxtFJi5GEfHWZOlWegJclnFT C3PQiCC/UAwYwYGqCGhTX663TTZ5NH0LPVryzThWf6lzfZFXoXzRKSdhJKd56s+jdf BCDtv6MaXEEQIXVYRXjPFELXIORmxDBVWq5Qfwrxgvc3EoLjDw3qyK/frlFnzKc39z rvl4CLXL6hpVihQWGx+7RIhCR+s/hYWZ8DI7nHo8AexPEI/sSwZO7hLw1H77DWYgYK cTZMBECpgEA9g== From: "Matthieu Baerts (NGI0)" Date: Fri, 10 May 2024 13:18:32 +0200 Subject: [PATCH net-next 2/8] mptcp: fix full TCP keep-alive support Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240510-upstream-net-next-20240509-misc-improvements-v1-2-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=5443; i=matttbe@kernel.org; h=from:subject:message-id; bh=gx0qqngzRCb+X3NtTvf6ue9ZR5QeWwvf6CM1qbMEY0Q=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmPgKcIc9HwzMrvpi3OdLqtATyRjcLlX+1i7ZJA zezNGV2ThSJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZj4CnAAKCRD2t4JPQmmg c1gZD/9CVUD5Ahvb5u7TKpKWBK6tGP8WSjoXhtb4JldU0AzwxL2B3srufsfMRs/0REPrvMrNKmx gmG1KylIFd4aypwO5UxCNRVttOD6fA9WtZfPs25dmpuMBd/FpMwca1o8PGndXK64YX1g5foG6os jt2n8vqB27dLGYbIq7/4uk69+C8tQAQkTIkZMI9blJYFW88wLiazyQt3WddAPqb8AiJ8LN48ryO WkAE27A0Y3er5LmCqbf//MzVrikPyt0STNTLHxJxc0YVeKAyGWhgD78zJkgoXEA3QvjqDh5uCCt gd5y5K8OLm4nkMOrAbYg6ItTBhNH3zgDewcPOUXLlUBeU57+4pXXSfs2HY1XcXlQc4oM4pBx456 gOUSL32Lj/36MwCCC/5bxuwPFZYCRp06+GLPZVML/59rzE+WWMHRHmbE1RW8WsRIAH6/5okf3ai 2AACTrIFYAPtgA59igPLp9+BP+dMUScSx48QcWiqCzyqW9A4hfEm+EqM5td7NaJWzayRXcmN2V8 E5YZAutEIgE8szAPl8Ox/Zno18Xm/5lH/txuJ7ocDbss3OzJzNX2+0BvFHSwiSSeojllRCxhGmP ib+NRl+ACfxZFBQJChk+NkIIWxKjxtPN4zgq9fNfwuLbXQ6BTdGT1eNMogGNvN0BMHLiCqDE3GR WfgFhGrWazRPerg== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Patchwork-Delegate: kuba@kernel.org SO_KEEPALIVE support has been added a while ago, as part of a series "adding SOL_SOCKET" support. To have a full control of this keep-alive feature, it is important to also support TCP_KEEP* socket options at the SOL_TCP level. Supporting them on the setsockopt() part is easy, it is just a matter of remembering each value in the MPTCP sock structure, and calling tcp_sock_set_keep*() helpers on each subflow. If the value is not modified (0), calling these helpers will not do anything. For the getsockopt() part, the corresponding value from the MPTCP sock structure or the default one is simply returned. All of this is very similar to other TCP_* socket options supported by MPTCP. It looks important for kernels supporting SO_KEEPALIVE, to also support TCP_KEEP* options as well: some apps seem to (wrongly) consider that if the former is supported, the latter ones will be supported as well. But also, not having this simple and isolated change is preventing MPTCP support in some apps, and libraries like GoLang [1]. This is why this patch is seen as a fix. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/383 Fixes: 1b3e7ede1365 ("mptcp: setsockopt: handle SO_KEEPALIVE and SO_PRIORITY") Link: https://github.com/golang/go/issues/56539 [1] Acked-by: Paolo Abeni Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/protocol.h | 3 +++ net/mptcp/sockopt.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index cfc5f9c3f113..4dcce3641d1d 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -312,6 +312,9 @@ struct mptcp_sock { free_first:1, rcvspace_init:1; u32 notsent_lowat; + int keepalive_cnt; + int keepalive_idle; + int keepalive_intvl; struct work_struct work; struct sk_buff *ooo_last_skb; struct rb_root out_of_order_queue; diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c index 69fc584fc57e..63a3edc75857 100644 --- a/net/mptcp/sockopt.c +++ b/net/mptcp/sockopt.c @@ -622,6 +622,31 @@ static int mptcp_setsockopt_sol_tcp_congestion(struct mptcp_sock *msk, sockptr_t return ret; } +static int __mptcp_setsockopt_set_val(struct mptcp_sock *msk, int max, + int (*set_val)(struct sock *, int), + int *msk_val, int val) +{ + struct mptcp_subflow_context *subflow; + int err = 0; + + mptcp_for_each_subflow(msk, subflow) { + struct sock *ssk = mptcp_subflow_tcp_sock(subflow); + int ret; + + lock_sock(ssk); + ret = set_val(ssk, val); + err = err ? : ret; + release_sock(ssk); + } + + if (!err) { + *msk_val = val; + sockopt_seq_inc(msk); + } + + return err; +} + static int __mptcp_setsockopt_sol_tcp_cork(struct mptcp_sock *msk, int val) { struct mptcp_subflow_context *subflow; @@ -818,6 +843,22 @@ static int mptcp_setsockopt_sol_tcp(struct mptcp_sock *msk, int optname, case TCP_NODELAY: ret = __mptcp_setsockopt_sol_tcp_nodelay(msk, val); break; + case TCP_KEEPIDLE: + ret = __mptcp_setsockopt_set_val(msk, MAX_TCP_KEEPIDLE, + &tcp_sock_set_keepidle_locked, + &msk->keepalive_idle, val); + break; + case TCP_KEEPINTVL: + ret = __mptcp_setsockopt_set_val(msk, MAX_TCP_KEEPINTVL, + &tcp_sock_set_keepintvl, + &msk->keepalive_intvl, val); + break; + case TCP_KEEPCNT: + ret = __mptcp_setsockopt_set_val(msk, MAX_TCP_KEEPCNT, + &tcp_sock_set_keepcnt, + &msk->keepalive_cnt, + val); + break; default: ret = -ENOPROTOOPT; } @@ -1326,6 +1367,8 @@ static int mptcp_put_int_option(struct mptcp_sock *msk, char __user *optval, static int mptcp_getsockopt_sol_tcp(struct mptcp_sock *msk, int optname, char __user *optval, int __user *optlen) { + struct sock *sk = (void *)msk; + switch (optname) { case TCP_ULP: case TCP_CONGESTION: @@ -1344,6 +1387,18 @@ static int mptcp_getsockopt_sol_tcp(struct mptcp_sock *msk, int optname, return mptcp_put_int_option(msk, optval, optlen, msk->cork); case TCP_NODELAY: return mptcp_put_int_option(msk, optval, optlen, msk->nodelay); + case TCP_KEEPIDLE: + return mptcp_put_int_option(msk, optval, optlen, + msk->keepalive_idle ? : + READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_keepalive_time) / HZ); + case TCP_KEEPINTVL: + return mptcp_put_int_option(msk, optval, optlen, + msk->keepalive_intvl ? : + READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_keepalive_intvl) / HZ); + case TCP_KEEPCNT: + return mptcp_put_int_option(msk, optval, optlen, + msk->keepalive_cnt ? : + READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_keepalive_probes)); case TCP_NOTSENT_LOWAT: return mptcp_put_int_option(msk, optval, optlen, msk->notsent_lowat); } @@ -1461,6 +1516,9 @@ static void sync_socket_options(struct mptcp_sock *msk, struct sock *ssk) tcp_set_congestion_control(ssk, msk->ca_name, false, true); __tcp_sock_set_cork(ssk, !!msk->cork); __tcp_sock_set_nodelay(ssk, !!msk->nodelay); + tcp_sock_set_keepidle_locked(ssk, msk->keepalive_idle); + tcp_sock_set_keepintvl(ssk, msk->keepalive_intvl); + tcp_sock_set_keepcnt(ssk, msk->keepalive_cnt); inet_assign_bit(TRANSPARENT, ssk, inet_test_bit(TRANSPARENT, sk)); inet_assign_bit(FREEBIND, ssk, inet_test_bit(FREEBIND, sk)); From patchwork Fri May 10 11:18:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13661348 X-Patchwork-Delegate: kuba@kernel.org 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 6C52D170820; Fri, 10 May 2024 11:19:03 +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=1715339944; cv=none; b=htr/kQKmbMj2xz4aAADX95ae3hkepjjlSZav5Alps0WHUzmobYxqXNnLBKOWT9m1dRnT8WbTgA3henpcaZQqcnlVaGWDGy+N49WWHfkjFzEA5f4zBx2JmGA75PCijSmwSVuQfyLNGA5gEIsY5y7Ssqn+q0FWqTSLz5CPhTidhKg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715339944; c=relaxed/simple; bh=pINmx7wjasMIzKOzIYi//6CSOIrW7PFU3u6Ef24zc9I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AxZJ4fYWzLLSi1X5Z3af8zkE7N3EYlHxhIXG0Ab4q67dMP6VQJBTU7ijEDC/csDxNs+YVcCB69IKqdby9teFWn4b5f9S2s1vlVy6dXFsBB3qh/RsA4xQuoVLrmgWJ3nN/i6d6BwD8YbzXojqShOA0s3Ix9zKtHUHDt8TvWGSXEc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EHa//+Rm; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EHa//+Rm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C6B3C32781; Fri, 10 May 2024 11:19:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715339943; bh=pINmx7wjasMIzKOzIYi//6CSOIrW7PFU3u6Ef24zc9I=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=EHa//+Rmb9cn8zOi/ZXRzswfG6jB2dAFNCce7FVetQwXVsX63XR6/B4qHXlnCN1iP PQCeyLU4UI6Qk4SN2AxV09E1l0R99tDL1f8gk644A2McCFgsiHWn6KP2P4sfVoaNAb 0Ruu0t6DLQpv4KcDOF3RiEp3Ox4wo/s5AjjQ6MGPDFqcyp8AJvfW5Ga7/ErVKHwqDI acF5ZRFEKctrH81FHdRLomzVreWR5w5mKaQ0d/0rnS7CV4ncZ3mnOyh89DWQ1nMVxW ciL4Ii2mQS9mLWN3QQtbZsN+YbmzqqbX6J1JTsNm6wEhyz4KqHE8Rp9cYf7YMbD7Ia mbPJNtvAcLdUA== From: "Matthieu Baerts (NGI0)" Date: Fri, 10 May 2024 13:18:33 +0200 Subject: [PATCH net-next 3/8] mptcp: sockopt: info: stop early if no buffer Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240510-upstream-net-next-20240509-misc-improvements-v1-3-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=1188; i=matttbe@kernel.org; h=from:subject:message-id; bh=pINmx7wjasMIzKOzIYi//6CSOIrW7PFU3u6Ef24zc9I=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmPgKcH1RuhQuyv02ND9Fv6tMewkMKpuR9jyHCj W+eN0IGmNOJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZj4CnAAKCRD2t4JPQmmg czetEADP6o+iepSNJOR6IvzfH6OZitnn2NkgObMiX9GYsoNlivJSa8H9GnhY02y/dp1D752Rw/3 6W2Z9V8HEEr9Ot5taL8BeTq+E29h2svpLufGn+eIPi6QsdqwItEj3h5P5SlYJO/X86KtxeG2bvQ +VplqCDQQHHFm0w6Vvb3v1ChyX1xwgqEQsBU3YPm4D7GIfJl/893gdQ8PHER+zTW1bsep7N5p1C MGetQY/zFJdtBMO7yYhD7XsQf/YpgK9nu2zDjZjqlSRvV+2erk6X9f01l9voU9jmrWZCKMLgLbZ e4SLqXl7wC2oFlqNvG9mMeOfCU67TDOJNHBtOto41lP6EuLkJSt/sDUHxnKaUT76MGpQodw7vkz 7qONNGC7WQIqSpPwBiC+2z0QPeOP7y1FYKcZStEuVzftC9BXOQYZpRCxrJV+6OtIzVGoNLYfGnl 8yZFKKL1Qw8yJphAitItwYMOsYuTgz0U0IEufRggX4fqaBZRlWkg2eVdl2MRZZOltCnkbrfPHv/ qVBj05h6jYvT2zaqrOdHwoDNdgKaOicfVo2VUJ+CyM7WE2raiu7qEvobYhhSRaxE3VzWNXeIN1+ 1Ad3karsAmZHV02qUcjcwwWqxqe77HCpaOyV0ORDJV/ZplZ4WsLbk1MKjNSAmSrl+ZbDAtxnYIF 6rI5krGOW0MMMmQ== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Patchwork-Delegate: kuba@kernel.org Up to recently, it has been recommended to use getsockopt(MPTCP_INFO) to check if a fallback to TCP happened, or if the client requested to use MPTCP. In this case, the userspace app is only interested by the returned value of the getsocktop() call, and can then give 0 for the option length, and NULL for the buffer address. An easy optimisation is then to stop early, and avoid filling a local buffer -- which now requires two different locks -- if it is not needed. Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/sockopt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c index 63a3edc75857..cc9ecccf219d 100644 --- a/net/mptcp/sockopt.c +++ b/net/mptcp/sockopt.c @@ -999,6 +999,10 @@ static int mptcp_getsockopt_info(struct mptcp_sock *msk, char __user *optval, in if (get_user(len, optlen)) return -EFAULT; + /* When used only to check if a fallback to TCP happened. */ + if (len == 0) + return 0; + len = min_t(unsigned int, len, sizeof(struct mptcp_info)); mptcp_diag_fill_info(msk, &m_info); From patchwork Fri May 10 11:18:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13661349 X-Patchwork-Delegate: kuba@kernel.org 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 2870C170858; Fri, 10 May 2024 11:19:06 +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=1715339947; cv=none; b=GRz1O/UZQ+xvhlVT98IMQNOCZ9QextrBWHdvAVjHhyDJNTHVCbcxMxzCyao2ORAVcu1Hsxli+HX64jU6+ngZBZhu528f5APnOT4t7UwXKium/HGu969CyH056E/GZDgl/cNdlOMziYGhnI9ThGAC8s0uff96de8FbX1RDBeLbxk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715339947; c=relaxed/simple; bh=mn3cUeuni9YG0Wzwevr2Z6WMUjH1cMxpP/hJKuF0rmw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CF5of2ofTXilSYdoV+GR3ZOgSp3byUUyBRiVkiE5xM3nICnCN6cNotb5CiqiTQ0j+lM6TSxP/rkLLEg4/3xsfZl2757sT8k6iG3yW/NDLMj+guL76PmXHvNQyXQioUPiIBrpjZ1BqIzO/juwb3PSxu6XqOSk4vAsZy28j4tLXM4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hvEo+gQT; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hvEo+gQT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E3CDC113CC; Fri, 10 May 2024 11:19:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715339946; bh=mn3cUeuni9YG0Wzwevr2Z6WMUjH1cMxpP/hJKuF0rmw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=hvEo+gQT9vX5KrEu6smR3HDsQUe/rlydmQxcve33Biv6UklBzfSbiXASCofFVClV9 4Tt4uT86nUo499QB9zFaFYjcdHE5PC8h2KNRmmiA9pcZb3DeSeUon+dEEyeLkoGJrx eXogtRk2RbwgRqQnRqIxaerc0+dEUl0Jvb8rQIeS02GowrlZGQA3AHd8fzMboIJzUK 84i6lA+p+l9BBbIQU7z745EWEq+Xl+A1amlGJDf5yt84tE+iSAAQ+x5HHkJlhFOvLn wnQzindeFxJDSBIpCl0wAVW0tAHqXj4WWTKhE43WAh2Kcq2hvPH3JIJM3Vdetw6Kb3 mqG6FcdMehhxw== From: "Matthieu Baerts (NGI0)" Date: Fri, 10 May 2024 13:18:34 +0200 Subject: [PATCH net-next 4/8] mptcp: add net.mptcp.available_schedulers Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240510-upstream-net-next-20240509-misc-improvements-v1-4-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)" , Gregory Detal X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4279; i=matttbe@kernel.org; h=from:subject:message-id; bh=t1Yh7WAxI11wVfzjw8nlaeU3n8BxQOHG92M634eRusw=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmPgKcDyBOeI187aOHNMo0SRQQcQ9DSshF6DCfc 7Xr+fBJAJWJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZj4CnAAKCRD2t4JPQmmg c6JIEADxMIDorQrlhIWMx4E9G4GPEsjfvnbVgRYF7S19eze6fI5+Rl+4cQXjk3Kw9vrpyljInxS zr03c4iUmIGaOJNiJ1Bj5Gz1TDx6SXuJUSHxqn1gLaeE/euzN3CLFUqSutAfQxFw6NB8G6gxRLp vgABit1HQ/fcrXbfCPPT124SZ1OzOfOrx02an9wdqhG0rUX44eb3xuJXlMOKfSus6rJJh8wlXOS 6wMDEX3Iwjg2yo3IfnS7VOH7lk0zJOvs0qUksR+20A7Ulp6OAVbVqkmFaOeY1GJIOlpbDx0uGh0 bVSTr6Y9IBYo3Ot3Jsvyn7IbE/a1BeQWaLVz1dsadAGw6TLi0UvI8cH54n+kvIz+/lq3HlLGENg 156kUyx5nhkSFt+fbl5yTKOuyIbUZilvM4I1eKDdZGIcdaHAXJwfeuLja66MWol2w4RyX/iwhVc +axdGE0PDNJbG08T37sNzuQbOOKzUXdlpJ+x1v3qRIOL9sDTHqQoEBhkX1w/NqVbD31vcfxhBIq gu3nSPZb0LQaO11WsR6S+8MoX7CqfmhbOO5VzPeSQBknNce2IJt5YTUIOM2PHbszrQ2ZzC9tUMH ug2Da/yRORSpBJ8Im8+0qgQwH1XoUjAyygpebNVaq/v1hTt8vjegFQtRS7cbMIzKeGMcvzlXaRp GtaggEa9r5E0JwA== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Patchwork-Delegate: kuba@kernel.org From: Gregory Detal The sysctl lists the available schedulers that can be set using net.mptcp.scheduler similarly to net.ipv4.tcp_available_congestion_control. Signed-off-by: Gregory Detal Reviewed-by: Mat Martineau Tested-by: Geliang Tang Reviewed-by: Matthieu Baerts (NGI0) Signed-off-by: Matthieu Baerts (NGI0) --- include/net/mptcp.h | 3 +++ net/mptcp/ctrl.c | 27 ++++++++++++++++++++++++++- net/mptcp/protocol.h | 1 + net/mptcp/sched.c | 22 ++++++++++++++++++++++ 4 files changed, 52 insertions(+), 1 deletion(-) diff --git a/include/net/mptcp.h b/include/net/mptcp.h index fb996124b3d5..0bc4ab03f487 100644 --- a/include/net/mptcp.h +++ b/include/net/mptcp.h @@ -97,6 +97,9 @@ struct mptcp_out_options { }; #define MPTCP_SCHED_NAME_MAX 16 +#define MPTCP_SCHED_MAX 128 +#define MPTCP_SCHED_BUF_MAX (MPTCP_SCHED_NAME_MAX * MPTCP_SCHED_MAX) + #define MPTCP_SUBFLOWS_MAX 8 struct mptcp_sched_data { diff --git a/net/mptcp/ctrl.c b/net/mptcp/ctrl.c index 49abf80b3fad..542555ba474c 100644 --- a/net/mptcp/ctrl.c +++ b/net/mptcp/ctrl.c @@ -133,6 +133,24 @@ static int proc_scheduler(struct ctl_table *ctl, int write, return ret; } +static int proc_available_schedulers(struct ctl_table *ctl, + int write, void *buffer, + size_t *lenp, loff_t *ppos) +{ + struct ctl_table tbl = { .maxlen = MPTCP_SCHED_BUF_MAX, }; + int ret; + + tbl.data = kmalloc(tbl.maxlen, GFP_USER); + if (!tbl.data) + return -ENOMEM; + + mptcp_get_available_schedulers(tbl.data, MPTCP_SCHED_BUF_MAX); + ret = proc_dostring(&tbl, write, buffer, lenp, ppos); + kfree(tbl.data); + + return ret; +} + static struct ctl_table mptcp_sysctl_table[] = { { .procname = "enabled", @@ -187,6 +205,12 @@ static struct ctl_table mptcp_sysctl_table[] = { .mode = 0644, .proc_handler = proc_scheduler, }, + { + .procname = "available_schedulers", + .maxlen = MPTCP_SCHED_BUF_MAX, + .mode = 0644, + .proc_handler = proc_available_schedulers, + }, { .procname = "close_timeout", .maxlen = sizeof(unsigned int), @@ -214,7 +238,8 @@ static int mptcp_pernet_new_table(struct net *net, struct mptcp_pernet *pernet) table[4].data = &pernet->stale_loss_cnt; table[5].data = &pernet->pm_type; table[6].data = &pernet->scheduler; - table[7].data = &pernet->close_timeout; + /* table[7] is for available_schedulers which is read-only info */ + table[8].data = &pernet->close_timeout; hdr = register_net_sysctl_sz(net, MPTCP_SYSCTL_PATH, table, ARRAY_SIZE(mptcp_sysctl_table)); diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index 4dcce3641d1d..39fc47e6b88a 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -686,6 +686,7 @@ unsigned int mptcp_stale_loss_cnt(const struct net *net); unsigned int mptcp_close_timeout(const struct sock *sk); int mptcp_get_pm_type(const struct net *net); const char *mptcp_get_scheduler(const struct net *net); +void mptcp_get_available_schedulers(char *buf, size_t maxlen); void __mptcp_subflow_fully_established(struct mptcp_sock *msk, struct mptcp_subflow_context *subflow, const struct mptcp_options_received *mp_opt); diff --git a/net/mptcp/sched.c b/net/mptcp/sched.c index 4ab0693c069c..4a7fd0508ad2 100644 --- a/net/mptcp/sched.c +++ b/net/mptcp/sched.c @@ -51,6 +51,28 @@ struct mptcp_sched_ops *mptcp_sched_find(const char *name) return ret; } +/* Build string with list of available scheduler values. + * Similar to tcp_get_available_congestion_control() + */ +void mptcp_get_available_schedulers(char *buf, size_t maxlen) +{ + struct mptcp_sched_ops *sched; + size_t offs = 0; + + rcu_read_lock(); + spin_lock(&mptcp_sched_list_lock); + list_for_each_entry_rcu(sched, &mptcp_sched_list, list) { + offs += snprintf(buf + offs, maxlen - offs, + "%s%s", + offs == 0 ? "" : " ", sched->name); + + if (WARN_ON_ONCE(offs >= maxlen)) + break; + } + spin_unlock(&mptcp_sched_list_lock); + rcu_read_unlock(); +} + int mptcp_register_scheduler(struct mptcp_sched_ops *sched) { if (!sched->get_subflow) From patchwork Fri May 10 11:18:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13661350 X-Patchwork-Delegate: kuba@kernel.org 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 C53EA17089A; Fri, 10 May 2024 11:19:09 +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=1715339949; cv=none; b=nXsRAFP5/hmMmSlAzF51DvGBgq1H7X1X2NSUquYCHipNPUyZ+BkN8qQwKwAqvhj3FA/EMGG5t2GsUfepxPGoRVj04UJqDDhMtWoSvG+NIoLP5dSNSM4RrkRqUEIkupoZJs8LZBjhPrz1plpP42VpeXPf0fhvlP7y7ZymrtUr+Js= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715339949; c=relaxed/simple; bh=xbCxQm7NYK+1wRRkdU1YZqrQE67obVDoGOLdbAX28Bo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AnqAexhRUcz/j0asQ5UxmdO6oTQFhV6MDVcY3So+02ADWQh6C+sJV6SJkxqaaWsrPN+Lj+vrWxXYe5sk933mwRy+2FiYobY8+DNEYHLmUhnQxLEqvImg0Pv+hodmIE/5wZLLCh5gcBldhe/I2ISQiwh04TP9P+ZNvMjVS5aiOuU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ARIWUGbW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ARIWUGbW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3DF1FC2BD11; Fri, 10 May 2024 11:19:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715339949; bh=xbCxQm7NYK+1wRRkdU1YZqrQE67obVDoGOLdbAX28Bo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ARIWUGbWqjKWCzXGTQUsQW2kEIY4+1FUaei1Ipim4kPSjhDdPLzYJttG293hD5XUV cIKGsTfW7rKLfeuGOudfHCPdb1VKXPSHBbUD3PZraHS5zpFhbgQ44LALBsHgpFROWU qZRNffnB9x5n18eYNYUQAf+X4dAd2XKgFYB5jYW6Y+OaMekwLZTcVWN56m4f2V0sjV 9spu5B272P33AsuXF0VEpOIph2Z3/XLaqAR8FumVd/5+NcBF0UwoLS1bG1qD2M4q49 1XSeDb0fXUrjRcVXSQexJyxrr0KtgFP5D0N4nJ1DMQQkaf8hcOZgW2IurT70hESj8l VxEVwp5RsISOg== From: "Matthieu Baerts (NGI0)" Date: Fri, 10 May 2024 13:18:35 +0200 Subject: [PATCH net-next 5/8] mptcp: prefer strscpy over strcpy Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240510-upstream-net-next-20240509-misc-improvements-v1-5-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=2664; i=matttbe@kernel.org; h=from:subject:message-id; bh=xbCxQm7NYK+1wRRkdU1YZqrQE67obVDoGOLdbAX28Bo=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmPgKcc2r9q5h7H1i/aLEx24OsCJy2Wa1zE3IeU fhSct5FzEqJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZj4CnAAKCRD2t4JPQmmg c7sPD/4hpkNHeOFB5lQSXgVrUQw2P3twOxcElic9JWU8YWa9taxfoCiyiX3HrgtDf3Q0o4F2lxb OE0UvdLcJ19w/JiBe/zpYPP99i/zsPCjdHSxhABcFC8RNOdm+cQY6AM1EBf7p/dkXc4M0YQrZzv m+mmh/T+Th/8Mz/ZFIL5wRRVB7SQZ+MiSAapKVOEFb+v698ho2LMFYoR1hLi0jp58zYoxCEJNIU JU+eiW9rJitvYfjeUv2XZ8fwfLc2IogattzWZLl600PdCxMpRhPz8VddaCjF5stqLxwD+F88rRJ obyAMIgvRW8CGxdl2TYFjKBLPMrO8OUvKeUfyo01jJJ4iGRfcnKMRrGZM2QB0XUxkfqY4Zsu8HT 39myYfpwbsLdhYe2VbLl+YmVm5NIgY4PgISPPGfzgvvMW3SQWO5CGNVx5Qzz3qS3ibxWdlhaJAv LCbHfX60lhnoojQKcNQsmOQmFcEJ8q4eQTu6JgkBwUOhJf4N9nlFDWs9AY/dXmMx39H8IA1evUB 0ljpYDgA4cqnWQKMsQixTFMaTjN1m/cIftewQFybJRlhy/FmHx9zo5ggXSdscU34a1updoTfRRi k9Gfc1A9pYCGMHEGArpZxmCK09fTgtm9ckdWfwZ48IGheFtTgIxeRX3l6EJ30TCSzFXdVIQHv3w XGyRvEbbr1I0UaQ== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Patchwork-Delegate: kuba@kernel.org strcpy() performs no bounds checking on the destination buffer. This could result in linear overflows beyond the end of the buffer, leading to all kinds of misbehaviors. The safe replacement is strscpy() [1]. This is in preparation of a possible future step where all strcpy() uses will be removed in favour of strscpy() [2]. This fixes CheckPatch warnings: WARNING: Prefer strscpy over strcpy Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy [1] Link: https://github.com/KSPP/linux/issues/88 [2] Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/ctrl.c | 2 +- net/mptcp/protocol.c | 5 +++-- net/mptcp/sockopt.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/net/mptcp/ctrl.c b/net/mptcp/ctrl.c index 542555ba474c..98b1dd498ff6 100644 --- a/net/mptcp/ctrl.c +++ b/net/mptcp/ctrl.c @@ -92,7 +92,7 @@ static void mptcp_pernet_set_defaults(struct mptcp_pernet *pernet) pernet->allow_join_initial_addr_port = 1; pernet->stale_loss_cnt = 4; pernet->pm_type = MPTCP_PM_TYPE_KERNEL; - strcpy(pernet->scheduler, "default"); + strscpy(pernet->scheduler, "default", sizeof(pernet->scheduler)); } #ifdef CONFIG_SYSCTL diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index bb8f96f2b86f..a42494d3a71b 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -2814,7 +2814,8 @@ static void mptcp_ca_reset(struct sock *sk) struct inet_connection_sock *icsk = inet_csk(sk); tcp_assign_congestion_control(sk); - strcpy(mptcp_sk(sk)->ca_name, icsk->icsk_ca_ops->name); + strscpy(mptcp_sk(sk)->ca_name, icsk->icsk_ca_ops->name, + sizeof(mptcp_sk(sk)->ca_name)); /* no need to keep a reference to the ops, the name will suffice */ tcp_cleanup_congestion_control(sk); @@ -4169,7 +4170,7 @@ int __init mptcp_proto_v6_init(void) int err; mptcp_v6_prot = mptcp_prot; - strcpy(mptcp_v6_prot.name, "MPTCPv6"); + strscpy(mptcp_v6_prot.name, "MPTCPv6", sizeof(mptcp_v6_prot.name)); mptcp_v6_prot.slab = NULL; mptcp_v6_prot.obj_size = sizeof(struct mptcp6_sock); mptcp_v6_prot.ipv6_pinfo_offset = offsetof(struct mptcp6_sock, np); diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c index cc9ecccf219d..0f6ef494525f 100644 --- a/net/mptcp/sockopt.c +++ b/net/mptcp/sockopt.c @@ -616,7 +616,7 @@ static int mptcp_setsockopt_sol_tcp_congestion(struct mptcp_sock *msk, sockptr_t } if (ret == 0) - strcpy(msk->ca_name, name); + strscpy(msk->ca_name, name, sizeof(msk->ca_name)); release_sock(sk); return ret; From patchwork Fri May 10 11:18:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13661351 X-Patchwork-Delegate: kuba@kernel.org 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 A487F16EC18; Fri, 10 May 2024 11:19:12 +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=1715339952; cv=none; b=QlFor8sQDrVCXK3pYd/z8FglNUZZQcUlJIdZGbomYF38OLC9i2FDrJgb+G1ZaK7iE7gN5aWnSKQx9XJyGgAXbZ6ZWAnukbxJsgygnq7CbNlulxVgqjXUMGr7KucJsURTNom25WIlcme53+NlblnXlHYoURO0Oy5NzMqo12TkuZc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715339952; c=relaxed/simple; bh=g9/Ts3HF1r1iy03o7GZp55OQrzTi5Lbtpm9Z2O40MPo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OtCDafUEYwVAsE9KKUI006kMUPA9pw8L6V/0RWJncVLmpkrBKL9yacOG+yqCWZ9Vx/2ECCDidUCWMgq+PYe4bXhvJ60rjWPd7XViUkUIwWYZNixmSUfDWD+p8IJsSk0UJ17C7V1et+P0NGf58NLoxWTMWlN8SBojV4jue1+xZYs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EZ33SQKl; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EZ33SQKl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F1F6AC32781; Fri, 10 May 2024 11:19:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715339952; bh=g9/Ts3HF1r1iy03o7GZp55OQrzTi5Lbtpm9Z2O40MPo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=EZ33SQKl6dO4lEs6fb7iiaz/O9behXw9uxJnd/Z4FSo7rxX0Gp0TYgyc9HrLD6/7G zp2TfgdWpo5FtBENqnYp6Z253uQ5MNdvKSdKUyHIJ85zhb6pbdnnVAK1q27X2tUznZ wxs2Y77mdrtldgycA3ecAg5k8DzDDImEYYcvd9skhHTzvASpuSbnWEmcxzgQjjgZtw WOerD8yEPZsQrfNN44+y0GDY06Uw/abVHy65ByUfjaPaelbtX1+ElKExb3hYqr9mma 2bpwFzWDNthjnqTM/EY6isKKM6XoV0XLyE4soNVLYnh69IDn2XAOM/9nEMuPhhy4Yi H9C3z4b1ENiBA== From: "Matthieu Baerts (NGI0)" Date: Fri, 10 May 2024 13:18:36 +0200 Subject: [PATCH net-next 6/8] mptcp: remove unnecessary else statements Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240510-upstream-net-next-20240509-misc-improvements-v1-6-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=2132; i=matttbe@kernel.org; h=from:subject:message-id; bh=g9/Ts3HF1r1iy03o7GZp55OQrzTi5Lbtpm9Z2O40MPo=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmPgKc1QcUYvndAnUHnijSXy1AReoYUZFJh7zL7 cPPQACSYUuJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZj4CnAAKCRD2t4JPQmmg czGoEAC3r8/aL+IMbek1lKsHeROt/gjlk3DFA3X53eSEsJNgKdA3tgXY2KippKQf7yOq106iXas WE0j6JyTXyKUtYxiWDkQfmzm4PDjazz1Tb3EDANRklWYcvsy/1ky8nfDgIQ6dG/+ijta49QkyF2 lNpP8UP9YZwGsMdUUlCQHamw7I81WUfWKYuGkiZuxWcAjdkV/9uG95OllFS70T10BdJjWibfSAP di8MHq/Ac5MxkABxmGWdlQ+JFM5VbOI9sJHbfwI0S3vEyrps8gvQaLzBQ0kVpiwIBvZM3vRmI5B DNQXoBi4csk4umXWC0ZoUMZ1y0sCbPCpc9cyrPw6XgcZExIXDpta6u84muR2ChA+EqJqYwkwRGQ OLs86zrz47yqSdNQelbx7eDo3FzTtNtBUQeMSwkzs9wMQA1qHRHgGVZ64FRzuGrrWwOQ/55HPk9 1+nTi1PLbZ8hCtoboYNBNk0lnN8LtTmMdEXeeUnZr55A4ZXOS2wC6M269RlNtETM54SxAwIpN3v X5wr+KWco/xxDgVW+rJw4ONMNOgf2C/LZi0zAxZukZ/KNEVTW1zksaBa2XQgFPzLPzc9FAOlLzT ZfMYFvT2u9U2yE3gGJUtwunro7ODYodNIx7foNNmgkgLrduMz3GKcQzUqylty+L940CzV9cUL5d VpveFJz48U78SAQ== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Patchwork-Delegate: kuba@kernel.org The 'else' statements are not needed here, because their previous 'if' block ends with a 'return'. This fixes CheckPatch warnings: WARNING: else is not generally useful after a break or return Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/subflow.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index c1d13e555d10..612c38570a64 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -1119,6 +1119,8 @@ static enum mapping_status get_mapping_status(struct sock *ssk, } if (mpext->data_fin == 1) { + u64 data_fin_seq; + if (data_len == 1) { bool updated = mptcp_update_rcv_data_fin(msk, mpext->data_seq, mpext->dsn64); @@ -1131,26 +1133,26 @@ static enum mapping_status get_mapping_status(struct sock *ssk, */ skb_ext_del(skb, SKB_EXT_MPTCP); return MAPPING_OK; - } else { - if (updated) - mptcp_schedule_work((struct sock *)msk); - - return MAPPING_DATA_FIN; } - } else { - u64 data_fin_seq = mpext->data_seq + data_len - 1; - /* If mpext->data_seq is a 32-bit value, data_fin_seq - * must also be limited to 32 bits. - */ - if (!mpext->dsn64) - data_fin_seq &= GENMASK_ULL(31, 0); + if (updated) + mptcp_schedule_work((struct sock *)msk); - mptcp_update_rcv_data_fin(msk, data_fin_seq, mpext->dsn64); - pr_debug("DATA_FIN with mapping seq=%llu dsn64=%d", - data_fin_seq, mpext->dsn64); + return MAPPING_DATA_FIN; } + data_fin_seq = mpext->data_seq + data_len - 1; + + /* If mpext->data_seq is a 32-bit value, data_fin_seq must also + * be limited to 32 bits. + */ + if (!mpext->dsn64) + data_fin_seq &= GENMASK_ULL(31, 0); + + mptcp_update_rcv_data_fin(msk, data_fin_seq, mpext->dsn64); + pr_debug("DATA_FIN with mapping seq=%llu dsn64=%d", + data_fin_seq, mpext->dsn64); + /* Adjust for DATA_FIN using 1 byte of sequence space */ data_len--; } From patchwork Fri May 10 11:18:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13661352 X-Patchwork-Delegate: kuba@kernel.org 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 6C95D171647; Fri, 10 May 2024 11:19:15 +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=1715339955; cv=none; b=IhAISdGj1KqtkxCvST72a5NZGZlGXAbjrdgvLR6l/PNhWIl6wfHf1Q5R9C2d4MSD4g91F1WaFFSY9atg3ym2kprqtj+wAAg63vlxkLgfTmFokzdr3Lp8mMyQJXv8fqutQaEZrRCdyN0Cwiscz0F/ixpUaGyaRwmRsOyz+NGxNnQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715339955; c=relaxed/simple; bh=0qU/gOVgR4w23LOX1Zx5qlGuFAeDrYdyX/AcBPsUaTU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=baC7Sx4vgmjt7uX3B/37npE9x/ybRrhNKVov0XO5llbKP4DopmjMFqy0yZEk3QafizqVxRxdQXyDb0AfZHLzleQ4GfvgIlHFOzY1chLVr6X7PmolnYJX6XeKEecgaBN3RG54lL+i9V4XrEAVT00hJN+LU63nspPua9W8yzRhiAs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gksBMzTm; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gksBMzTm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B2948C32783; Fri, 10 May 2024 11:19:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715339955; bh=0qU/gOVgR4w23LOX1Zx5qlGuFAeDrYdyX/AcBPsUaTU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=gksBMzTmGSGTENEl2EH6c4CyIwlcoGV/0tklnj7AdXV1WoVD+93L8+1vrZyto+UV4 4kcFvNCw42wPjO4PNtCTjIc6u/PAdWma5AFA1WteqhJb0P7769l41oPgBdr7VVTz91 SWCvLKKCdMRCgdzoIMmKZCsnvJW9mLKKq1mc50lz0GKzr9uOsurdwD3Qw8RuH9ss+L 2HPD62zaDKH6HuJky8qIZCN5Wz1tm/ASSSlWbJU+HWU2nm/gr8LnWuDaW5RauxO+RE CwS9FoUrOgjgoUP6vRen7p33WYMvdNE2hdcrFn/Xe3MuityLBq1BHfEPmzYTed67IJ Jag86unjwxB3Q== From: "Matthieu Baerts (NGI0)" Date: Fri, 10 May 2024 13:18:37 +0200 Subject: [PATCH net-next 7/8] mptcp: move mptcp_pm_gen.h's include Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240510-upstream-net-next-20240509-misc-improvements-v1-7-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=1438; i=matttbe@kernel.org; h=from:subject:message-id; bh=0qU/gOVgR4w23LOX1Zx5qlGuFAeDrYdyX/AcBPsUaTU=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmPgKcyj0TQnpFbvKf9qbjboDG/3ukzMr1dnpsH YHr/OTLFvaJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZj4CnAAKCRD2t4JPQmmg c5gKD/4/Qf6JyFQojNqOHb83IgZ06inLDIryY6SJ8JXugXsJtEQ/2k3cbltqI9xau7TRP376NIU BRlhMQ7C/ni/Q9uRPHUdo2lkXM2flbAFQKSldXOzNkSmL46QwdOd81d4fb+IazfOYPQPIcnQVSr niR1WbRz6LsYl+9nqyaP7sSdNVhzSKwQY93sqdFp1jdrGotMUu36DU0rytvo65f5aIItBgEIgCU oRaYwmv9nc/nsHlbEt8MPvI3lpaIO9vtizq/15ZNTYLZ66MM1seOSmdK0l7+id0ensOOzpj2VAI bSVSS5VrjFKFxnRz0+Zi+kcFgyZW8rb73lFxPlhFF5KmAGr5cC7A7aRvoVH5stCzn4Q2e1yHCT6 A8FFxC/aQ+RuN0Qk8vDuBpgRccYKqeOfGqWjFOf8QHRE38SayzW5zOWSi/0MO4pn+9kPs5QBQ8g 18raPSEs1u1tragJecfRRM84inYKUb8x8leqr8SPpGA/XmDHmBQbZlY1doRSwg7rM9m6MEbkJep HEoR8Shcir2HKwd1qP8bzebzFN8FULwqEgwuCGLgE79JKQ8S/iGNB1Tj2lV5yHPnQwnqCkFzylf Dl4Uk29CQv0OzXbTPGa9SFYkZBBhuHkJJ0IgzWfBwZy8xwgs0yq3F31n3MLyfrCdwo5Dge+t2Kx Y953lIbJWdEmdHA== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Patchwork-Delegate: kuba@kernel.org Nothing from protocol.h depends on mptcp_pm_gen.h, only code from pm_netlink.c and pm_userspace.c depends on it. So this include can be moved where it is needed to avoid a "unused includes" warning. Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/pm_netlink.c | 1 + net/mptcp/pm_userspace.c | 1 + net/mptcp/protocol.h | 2 -- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 5c17d39146ea..7f53e022e27e 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -14,6 +14,7 @@ #include "protocol.h" #include "mib.h" +#include "mptcp_pm_gen.h" static int pm_nl_pernet_id; diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c index 9f5d422d5ef6..f0a4590506c6 100644 --- a/net/mptcp/pm_userspace.c +++ b/net/mptcp/pm_userspace.c @@ -6,6 +6,7 @@ #include "protocol.h" #include "mib.h" +#include "mptcp_pm_gen.h" void mptcp_free_local_addr_list(struct mptcp_sock *msk) { diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index 39fc47e6b88a..7aa47e2dd52b 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -14,8 +14,6 @@ #include #include -#include "mptcp_pm_gen.h" - #define MPTCP_SUPPORTED_VERSION 1 /* MPTCP option bits */ From patchwork Fri May 10 11:18:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13661353 X-Patchwork-Delegate: kuba@kernel.org 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 23DA5171E41; Fri, 10 May 2024 11:19:17 +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=1715339958; cv=none; b=X5ht7OkrKCiN1mW44wXyhnRnSCg4iUtgxqtdfhgVd4F3EYHPiyCyKPXYtF5CQ95iKdl3wVWBZg8jj/hHeuDfpaDMhnNsNHCDxn41iM5RMuSr3l8YfTyhos+kEdmvmDiE+/Iui4Gzo8af7TfYRBBEKq4rHM2OAv35ReunzWF7x08= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715339958; c=relaxed/simple; bh=6/hr6NKWVk5ktON4L8zlBVjlDBR2emmr9M+/RKd+Pms=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IDxN4Y5Zebna3157QDUHxBOcEu1X+W48xQEhZVIsG2zqF1Bu4C5INFdpDjR3d5xXSUQBOexbfXVNOQTKebpt0C0JZ55AYquAVUXbmhGbtlgYMOK6Zp5gnl/8xI4ijn+c7uK2oDFWRLz4T0PJKkc//6B8V882JW5lX0GTyA3jEoU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=C5OW2fI/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="C5OW2fI/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71DE2C2BD11; Fri, 10 May 2024 11:19:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715339957; bh=6/hr6NKWVk5ktON4L8zlBVjlDBR2emmr9M+/RKd+Pms=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=C5OW2fI/fGe9x33M0ewfh2YfkWUOM/q5zIMqaQj8V4lADMF6ZrOCXD/RtHvWbHoBn VR/DKJlrFJivzpkIe5uJEWmkTCWiEeaZcn+KhR6tG+C4+43TxrkEOwkVkHKOadD1CW EzzK7WG+6CAW9+hnGqkSp0WeTbaRq74TEl2CjfK4qkCCrzCKiiQlN5WweOk992lcPM HV//z+zvwNJsbLXIaK71RSWxS+NprZJSCbzfeIsaCHOI6S75L5z42takNHwMzhcf9E Rao6QUxpwv2YOl7pkKe3zeFMJO0qBbDMg+KRvVtVuQEwwybwR/xZvtdueRM+xn68S1 DhTh2MbWr/jAw== From: "Matthieu Baerts (NGI0)" Date: Fri, 10 May 2024 13:18:38 +0200 Subject: [PATCH net-next 8/8] mptcp: include inet_common in mib.h Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240510-upstream-net-next-20240509-misc-improvements-v1-8-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=633; i=matttbe@kernel.org; h=from:subject:message-id; bh=6/hr6NKWVk5ktON4L8zlBVjlDBR2emmr9M+/RKd+Pms=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmPgKcPo3L1SVb73QC7nbRWCJhmgtvOCR1VhoGV yxh2JYims6JAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZj4CnAAKCRD2t4JPQmmg c9ZsEADaaL2em1xg7yqRBIWbfmc3hAErMgb6bkhT6qo6Ooy8fHtrCRCS7ohC7JePoKgsE2Uol0/ EHmd4yuOBmI4xfTTY4mhrGsIbTDquZYoJDVQ2NDuD1AHMXvj65BwzfKJHPs+b8iD3qZbbB5Ty8D qcAG2zKt/JIGBpim8U/ysF5rnOhv6szQpd3JQcCzGqYySKza8v0MLIYpI3c6qVMi40RzuQxr1Cr fd4oYiIPrpp4e3TWFjuZAdW/dcwikiVTSfNMfi2vJYeN2tP7yonS4i+5dRQlby2bJHIlX5KOdPp rImjbCEgwZMu/K+rTpQIeXHdzcgIULkPO53D21+kt0WGvYALQK8iPgNIIJMtf0uoPamYb9T5Yv9 8Sf2RsfC7H6DngaLe1M46cPB+U6L3spT1rVEoYSXdsfhHIaKP57Yoa6cVtBo+5LijdczAP2fr8F /X1DoWNil12dSit2H7kkXpGm0pLDCH3BgvmRFG5Oau87W7nOPW9NcmamFpqGGNjR04aiE954j+R N71t2KXZ6x4kcCdFlJixpQBNv5S2IEhBzaA2uqUSA/V5YsmIqZWCHrqWMVDJ0ceSacVWXQQmDhA ECvWzpmb8v05TgV8sRCK88zXfE97NzQl5In2Bs/CKk252lJbgU5mAhgWXahzHzZfx3YuHPLIwCo Sb2c+8m80MZE/Lw== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Patchwork-Delegate: kuba@kernel.org So this file is now self-contained: it can be compiled alone with analytic tools. Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/mib.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/mptcp/mib.h b/net/mptcp/mib.h index dd7fd1f246b5..2704afd0dfe4 100644 --- a/net/mptcp/mib.h +++ b/net/mptcp/mib.h @@ -1,5 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ +#include + enum linux_mptcp_mib_field { MPTCP_MIB_NUM = 0, MPTCP_MIB_MPCAPABLEPASSIVE, /* Received SYN with MP_CAPABLE */