summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorJeremy Kerr <jk@codeconstruct.com.au>2024-02-19 17:51:50 +0800
committerPaolo Abeni <pabeni@redhat.com>2024-02-22 13:32:55 +0100
commit43e6795574f5d75284a3cb21f5b76a5ffb98e8e6 (patch)
tree962a0d65f12cd519781afefb61d3568a3e46c41c /include/net
parenta1f4cf5791e7914f3e42f5462669353104fef8a9 (diff)
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 'include/net')
-rw-r--r--include/net/mctp.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/mctp.h b/include/net/mctp.h
index f937a325ea6f..0dfae6f51a32 100644
--- a/include/net/mctp.h
+++ b/include/net/mctp.h
@@ -133,6 +133,7 @@ struct mctp_sock {
* - through an expiry timeout, on a per-socket timer
*/
struct mctp_sk_key {
+ unsigned int net;
mctp_eid_t peer_addr;
mctp_eid_t local_addr; /* MCTP_ADDR_ANY for local owned tags */
__u8 tag; /* incoming tag match; invert TO for local */
@@ -254,6 +255,7 @@ int mctp_local_output(struct sock *sk, struct mctp_route *rt,
void mctp_key_unref(struct mctp_sk_key *key);
struct mctp_sk_key *mctp_alloc_local_tag(struct mctp_sock *msk,
+ unsigned int netid,
mctp_eid_t local, mctp_eid_t peer,
bool manual, u8 *tagp);