net: mctp: separate key correlation across nets
authorJeremy Kerr <jk@codeconstruct.com.au>
Mon, 19 Feb 2024 09:51:50 +0000 (17:51 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 22 Feb 2024 12:32:55 +0000 (13:32 +0100)
commit43e6795574f5d75284a3cb21f5b76a5ffb98e8e6
tree962a0d65f12cd519781afefb61d3568a3e46c41c
parenta1f4cf5791e7914f3e42f5462669353104fef8a9
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>
include/net/mctp.h
net/mctp/af_mctp.c
net/mctp/route.c
net/mctp/test/route-test.c