Message ID | 20241211-mctp-next-v1-3-e392f3d6d154@codeconstruct.com.au (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: mctp: MCTP core updates | expand |
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;
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@codeconstruct.com.au> --- net/mctp/af_mctp.c | 3 +++ 1 file changed, 3 insertions(+)