[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241211-mctp-next-v1-3-e392f3d6d154@codeconstruct.com.au>
Date: Wed, 11 Dec 2024 13:56:18 +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 3/3] net: mctp: Allow MCTP_NET_ANY for v2 tag
control ioctls
With ALLOCTAG2/DROPTAG2, we added a net field, to allow allocating tags
outside of the default network. However, we may still want to use the
same ioctl for a default net, so implement the same NET_ANY logic which
falls back to the default net.
This makes it a little more ergonomic to use the ALLOCTAG2/DROPTAG2
interfaces on simpler MCTP network setups.
Signed-off-by: Jeremy Kerr <jk@...econstruct.com.au>
---
net/mctp/af_mctp.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/mctp/af_mctp.c b/net/mctp/af_mctp.c
index 87adb4b81ca3ee7d240c80a8a40c4a2e8a876075..1086bff475c1c475df24aedf09737186f87e196f 100644
--- a/net/mctp/af_mctp.c
+++ b/net/mctp/af_mctp.c
@@ -383,6 +383,9 @@ static int mctp_ioctl_tag_copy_from_user(struct net *net, unsigned long arg,
ctl->tag = ctl_compat.tag;
}
+ if (ctl->net == MCTP_NET_ANY)
+ ctl->net = mctp_default_net(net);
+
if (ctl->flags)
return -EINVAL;
--
2.39.2
Powered by blists - more mailing lists