summaryrefslogtreecommitdiff
path: root/net/mctp/af_mctp.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@codeconstruct.com.au>2024-02-19 12:51:50 +0300
committerPaolo Abeni <pabeni@redhat.com>2024-02-22 15:32:55 +0300
commit43e6795574f5d75284a3cb21f5b76a5ffb98e8e6 (patch)
tree962a0d65f12cd519781afefb61d3568a3e46c41c /net/mctp/af_mctp.c
parenta1f4cf5791e7914f3e42f5462669353104fef8a9 (diff)
downloadlinux-43e6795574f5d75284a3cb21f5b76a5ffb98e8e6.tar.xz
net: mctp: separate key correlation across nets
Currently, we lookup sk_keys from the entire struct net_namespace, which may contain multiple MCTP net IDs. In those cases we want to distinguish between endpoints with the same EID but different net ID. Add the net ID data to the struct mctp_sk_key, populate on add and filter on this during route lookup. For the ioctl interface, we use a default net of MCTP_INITIAL_DEFAULT_NET (ie., what will be in use for single-net configurations), but we'll extend the ioctl interface to provide net-specific tag allocation in an upcoming change. Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/mctp/af_mctp.c')
-rw-r--r--net/mctp/af_mctp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/mctp/af_mctp.c b/net/mctp/af_mctp.c
index d8197e9e233b..05315a422ffb 100644
--- a/net/mctp/af_mctp.c
+++ b/net/mctp/af_mctp.c
@@ -367,8 +367,8 @@ static int mctp_ioctl_alloctag(struct mctp_sock *msk, unsigned long arg)
if (ctl.flags)
return -EINVAL;
- key = mctp_alloc_local_tag(msk, MCTP_ADDR_ANY, ctl.peer_addr,
- true, &tag);
+ key = mctp_alloc_local_tag(msk, MCTP_INITIAL_DEFAULT_NET,
+ MCTP_ADDR_ANY, ctl.peer_addr, true, &tag);
if (IS_ERR(key))
return PTR_ERR(key);