[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241211-mctp-next-v1-2-e392f3d6d154@codeconstruct.com.au>
Date: Wed, 11 Dec 2024 13:56:17 +0800
From: Jeremy Kerr <jk@...econstruct.com.au>
To: Matt Johnston <matt@...econstruct.com.au>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>
Cc: netdev@...r.kernel.org
Subject: [PATCH net-next 2/3] net: mctp: Don't use MCTP_INITIAL_DEFAULT_NET
for a fallback net
INITIAL_DEFAULT_NET is only the *initial* default; we should be using
the current value from mctp_default_net() instead.
Nothing is currently setting the default_net away from its initial
value, so no functional change at present.
Signed-off-by: Jeremy Kerr <jk@...econstruct.com.au>
---
net/mctp/af_mctp.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/mctp/af_mctp.c b/net/mctp/af_mctp.c
index f6de136008f6f9b029e7dacc2e75dce1cd7fd075..87adb4b81ca3ee7d240c80a8a40c4a2e8a876075 100644
--- a/net/mctp/af_mctp.c
+++ b/net/mctp/af_mctp.c
@@ -353,7 +353,7 @@ static int mctp_getsockopt(struct socket *sock, int level, int optname,
/* helpers for reading/writing the tag ioc, handling compatibility across the
* two versions, and some basic API error checking
*/
-static int mctp_ioctl_tag_copy_from_user(unsigned long arg,
+static int mctp_ioctl_tag_copy_from_user(struct net *net, unsigned long arg,
struct mctp_ioc_tag_ctl2 *ctl,
bool tagv2)
{
@@ -376,7 +376,7 @@ static int mctp_ioctl_tag_copy_from_user(unsigned long arg,
if (!tagv2) {
/* compat, using defaults for new fields */
- ctl->net = MCTP_INITIAL_DEFAULT_NET;
+ ctl->net = mctp_default_net(net);
ctl->peer_addr = ctl_compat.peer_addr;
ctl->local_addr = MCTP_ADDR_ANY;
ctl->flags = ctl_compat.flags;
@@ -431,7 +431,7 @@ static int mctp_ioctl_alloctag(struct mctp_sock *msk, bool tagv2,
u8 tag;
int rc;
- rc = mctp_ioctl_tag_copy_from_user(arg, &ctl, tagv2);
+ rc = mctp_ioctl_tag_copy_from_user(net, arg, &ctl, tagv2);
if (rc)
return rc;
@@ -475,7 +475,7 @@ static int mctp_ioctl_droptag(struct mctp_sock *msk, bool tagv2,
int rc;
u8 tag;
- rc = mctp_ioctl_tag_copy_from_user(arg, &ctl, tagv2);
+ rc = mctp_ioctl_tag_copy_from_user(net, arg, &ctl, tagv2);
if (rc)
return rc;
--
2.39.2
Powered by blists - more mailing lists