From nobody Mon Feb 9 13:35:58 2026 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a05:6a06:1788:b0:4ac:5e5b:1ad1 with SMTP id y8csp901130piq; Tue, 29 Mar 2022 04:35:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1wwn0Q0hYPhva5QVLkgPkyKxsLdJb9HhuINdDZEkwcdg/GpaH9ALML+Olv5mOIqUJhGa6 X-Received: by 2002:a05:6214:27e1:b0:441:651c:1cb5 with SMTP id jt1-20020a05621427e100b00441651c1cb5mr25210862qvb.71.1648553743719; Tue, 29 Mar 2022 04:35:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648553743; cv=none; d=google.com; s=arc-20160816; b=sUcNPTV6YwJGDl9FgcLpkRgHo+pleaLZVJxJ1HhU8ePIt4rLcz+mXUTVjIBLAWIgBS XhAmu0mjz4Agwv7ftaIsQbL2Z5AZFfH7d/GVqq/hVR3Kh+2JqMbQzXeXAt74cx+Wh/Lw BYO6hW89wRAhRNJegJtD3H3FYw+HpeC6XwyOvIGloGPxD/UedJIvn1+YHYu3+YzV7gPI YcO3LOaLufs9blqVPW4G29Zktzx3ktxbDTlKyyvIy6RiA5BZHWLDFmiN4RSB1s7RGjQH mMRHPSYCPrCNlBCJcfwVSLIVrhD9P0e4toxfETGYmWzctVoHg0HngZ/+1Kinv5Jq+fi0 FOSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=3F2rl6e/gTzmc0Dhu5tGecasBh4apkUN7Qku3xiEkmE=; b=ZeWlrJT/Ez39K5OhBAD0wJC41WYDjLrSGBcEnDwR2hFovrDzOxIyrYLSD9EaAj3Opi TFXrjEE2xOzokeY4NmHYq9/+v0HWJPtIyLOX/cNZ54vjtnupw7DUAoiF1256LYEVwo2K rxFNzOVWtpK/7uRq8sw9EgFACUTXfAxk73UpcVms3Z8aKivjAQmO/57LfvNVKhUeDVaY B6kouHR81Y5WgO4gboiGuNRvpMHnrS3pbVOEL5NBAZOGTlJxSn5CSWyQOJS7SP/bf6xM kmuKomiFukEl0UtVBuWHNPpYjm/JfOawovUCGGhkM98qxklJYoHQvjG8jOZI8PC9kDtZ mPhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of mptcp+bounces-4524-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.197.195 as permitted sender) smtp.mailfrom="mptcp+bounces-4524-wpasupplicant.patchew=gmail.com@lists.linux.dev" Return-Path: Received: from ewr.edge.kernel.org (ewr.edge.kernel.org. [147.75.197.195]) by mx.google.com with ESMTPS id o12-20020ac85a4c000000b002e1fbf3c0e9si12012908qta.730.2022.03.29.04.35.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Mar 2022 04:35:43 -0700 (PDT) Received-SPF: pass (google.com: domain of mptcp+bounces-4524-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.197.195 as permitted sender) client-ip=147.75.197.195; Authentication-Results: mx.google.com; spf=pass (google.com: domain of mptcp+bounces-4524-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.197.195 as permitted sender) smtp.mailfrom="mptcp+bounces-4524-wpasupplicant.patchew=gmail.com@lists.linux.dev" 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 ewr.edge.kernel.org (Postfix) with ESMTPS id 0B9F61C09CF for ; Tue, 29 Mar 2022 11:35:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 04FCC7C; Tue, 29 Mar 2022 11:35:42 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [193.142.43.52]) (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 81614211E for ; Tue, 29 Mar 2022 11:35:40 +0000 (UTC) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1nZA8K-0004uE-KY; Tue, 29 Mar 2022 13:35:32 +0200 From: Florian Westphal To: Cc: Florian Westphal Subject: [PATCH mptcp-next v3 1/4] mptcp: diag: switch to context structure Date: Tue, 29 Mar 2022 13:35:20 +0200 Message-Id: <20220329113523.19793-2-fw@strlen.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220329113523.19793-1-fw@strlen.de> References: <20220329113523.19793-1-fw@strlen.de> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Raw access to cb->arg[] is deprecated, use a context structure. Signed-off-by: Florian Westphal --- no change. net/mptcp/mptcp_diag.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/net/mptcp/mptcp_diag.c b/net/mptcp/mptcp_diag.c index f44125dd6697..c4992eeb67d8 100644 --- a/net/mptcp/mptcp_diag.c +++ b/net/mptcp/mptcp_diag.c @@ -66,20 +66,28 @@ static int mptcp_diag_dump_one(struct netlink_callback = *cb, return err; } =20 +struct mptcp_diag_ctx { + long s_slot; + long s_num; +}; + static void mptcp_diag_dump(struct sk_buff *skb, struct netlink_callback *= cb, const struct inet_diag_req_v2 *r) { bool net_admin =3D netlink_net_capable(cb->skb, CAP_NET_ADMIN); + struct mptcp_diag_ctx *diag_ctx =3D (void *)cb->ctx; struct net *net =3D sock_net(skb->sk); struct inet_diag_dump_data *cb_data; struct mptcp_sock *msk; struct nlattr *bc; =20 + BUILD_BUG_ON(sizeof(cb->ctx) < sizeof(*diag_ctx)); + cb_data =3D cb->data; bc =3D cb_data->inet_diag_nla_bc; =20 - while ((msk =3D mptcp_token_iter_next(net, &cb->args[0], &cb->args[1])) != =3D - NULL) { + while ((msk =3D mptcp_token_iter_next(net, &diag_ctx->s_slot, + &diag_ctx->s_num)) !=3D NULL) { struct inet_sock *inet =3D (struct inet_sock *)msk; struct sock *sk =3D (struct sock *)msk; int ret =3D 0; @@ -101,7 +109,7 @@ static void mptcp_diag_dump(struct sk_buff *skb, struct= netlink_callback *cb, sock_put(sk); if (ret < 0) { /* will retry on the same position */ - cb->args[1]--; + diag_ctx->s_num--; break; } cond_resched(); --=20 2.35.1