diff options
author | Jeremy Kerr <jk@codeconstruct.com.au> | 2024-02-19 10:51:50 +0100 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2024-02-22 13:32:55 +0100 |
commit | 43e6795574f5d75284a3cb21f5b76a5ffb98e8e6 (patch) | |
tree | 962a0d65f12cd519781afefb61d3568a3e46c41c /include/net/mctp.h | |
parent | net: mctp: tests: create test skbs with the correct net and device (diff) | |
download | linux-43e6795574f5d75284a3cb21f5b76a5ffb98e8e6.tar.xz linux-43e6795574f5d75284a3cb21f5b76a5ffb98e8e6.zip |
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/mctp.h')
-rw-r--r-- | include/net/mctp.h | 2 |
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); |