From nobody Sun Dec 22 03:59:17 2024 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 F1A5715D5C1 for ; Mon, 7 Oct 2024 10:53:44 +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=1728298425; cv=none; b=MZryYr3S1tgk+XtxNoi1i7xgxTRj68MB39Xsxd117EjLt2IcDxbBpHHySpP/w1YpMqgqLrptoYWJ8s+Ph0TMbnmyOZg1zKBo9c7EI/viREQ6oeAebRuRIQXnj4Ok53YBAw6DcjHDeEwwcPylMGk35RhnysTQPpUtox9wqv9kmJ4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728298425; c=relaxed/simple; bh=rdUifMuXEBUI1GLxjTIkp2/5JSVtp7u8BDcoHWINhwY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Zst9SWVtUHnyQRM/IzC7p+Oraoq15x2DS4BrnXjs+gHeCBqbhTR9Twf7wpK7GpGCBrdDCngC/hkFaO7DneD6p67fpaeyxSMoKSSuHCz26dB+GRFz10HWzHW+ctOdpGgMrPT4jv4APXSUHEJqDPgh9FLIqHkNZgFoinlnJwy/KNE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mlcb3sbM; 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="mlcb3sbM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 858E0C4CECD; Mon, 7 Oct 2024 10:53:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728298424; bh=rdUifMuXEBUI1GLxjTIkp2/5JSVtp7u8BDcoHWINhwY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mlcb3sbM0POaAjBAb+6Xa09DIHV8ERm6niSWW89+PXN8db0QUSkydMTF/2ZvbaZXT QjboCBkPtizs5rxkf1jJ9I9gqTuFRBo4DjN/4Zd/7M8bkoZhPpXt+1/g1lCMDtrJGf G3u2KCJmBV/tMGFWqTOu3hXoTEDLzCMSnZcJxLOg69HdJ3CHSEXdUC8Z5EEKiMNkgQ NsFTqo0PYqOWdUqIGsPHQhyrx+XEMHJKUU6N1wIY/qo+Y69CZ80cXit8L64AxB52Yh IMOUpnhnnrdbZ31DOkJiUyfDAdhXVy4g+9J2b2kaoilMr1Q+yNjEuFBHCwo3shTBVH MZtMgSfAcSgeA== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v3 10/10] mptcp: drop skb parameter of set_flags Date: Mon, 7 Oct 2024 18:53:22 +0800 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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" From: Geliang Tang The first parameter "skb" in mptcp_pm_nl_set_flags() is only used to obtained the network namespace, which can also be obtained through the second parameters "info" by using genl_info_net() helper. This patch drops these useless parameters "skb" in all three set_flags() interfaces. Signed-off-by: Geliang Tang --- net/mptcp/pm_netlink.c | 12 ++++++------ net/mptcp/pm_userspace.c | 2 +- net/mptcp/protocol.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index f02378e9a9c8..0f2fe64fd568 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -2025,13 +2025,13 @@ static int mptcp_nl_set_flags(struct net *net, return ret; } =20 -static int mptcp_pm_nl_set_flags(struct sk_buff *skb, struct genl_info *in= fo) +static int mptcp_pm_nl_set_flags(struct genl_info *info) { struct mptcp_pm_addr_entry addr =3D { .addr =3D { .family =3D AF_UNSPEC }= , }; struct nlattr *attr =3D info->attrs[MPTCP_PM_ATTR_ADDR]; u8 changed, mask =3D MPTCP_PM_ADDR_FLAG_BACKUP | MPTCP_PM_ADDR_FLAG_FULLMESH; - struct net *net =3D sock_net(skb->sk); + struct net *net =3D genl_info_net(info); struct mptcp_pm_addr_entry *entry; struct pm_nl_pernet *pernet; u8 lookup_by_id =3D 0; @@ -2079,16 +2079,16 @@ static int mptcp_pm_nl_set_flags(struct sk_buff *sk= b, struct genl_info *info) return 0; } =20 -static int mptcp_pm_set_flags(struct sk_buff *skb, struct genl_info *info) +static int mptcp_pm_set_flags(struct genl_info *info) { if (info->attrs[MPTCP_PM_ATTR_TOKEN]) - return mptcp_userspace_pm_set_flags(skb, info); - return mptcp_pm_nl_set_flags(skb, info); + return mptcp_userspace_pm_set_flags(info); + return mptcp_pm_nl_set_flags(info); } =20 int mptcp_pm_nl_set_flags_doit(struct sk_buff *skb, struct genl_info *info) { - return mptcp_pm_set_flags(skb, info); + return mptcp_pm_set_flags(info); } =20 static void mptcp_nl_mcast_send(struct net *net, struct sk_buff *nlskb, gf= p_t gfp) diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c index e9977eddd1d3..512260e4afb2 100644 --- a/net/mptcp/pm_userspace.c +++ b/net/mptcp/pm_userspace.c @@ -536,7 +536,7 @@ int mptcp_pm_nl_subflow_destroy_doit(struct sk_buff *sk= b, struct genl_info *info return err; } =20 -int mptcp_userspace_pm_set_flags(struct sk_buff *skb, struct genl_info *in= fo) +int mptcp_userspace_pm_set_flags(struct genl_info *info) { struct mptcp_pm_addr_entry loc =3D { .addr =3D { .family =3D AF_UNSPEC },= }; struct nlattr *attr_rem =3D info->attrs[MPTCP_PM_ATTR_ADDR_REMOTE]; diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index 238fb2ddb68a..41d01a046e27 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -1035,7 +1035,7 @@ mptcp_pm_del_add_timer(struct mptcp_sock *msk, struct mptcp_pm_add_entry * mptcp_lookup_anno_list_by_saddr(const struct mptcp_sock *msk, const struct mptcp_addr_info *addr); -int mptcp_userspace_pm_set_flags(struct sk_buff *skb, struct genl_info *in= fo); +int mptcp_userspace_pm_set_flags(struct genl_info *info); int mptcp_pm_announce_addr(struct mptcp_sock *msk, const struct mptcp_addr_info *addr, bool echo); --=20 2.43.0