net: mctp: add MCTP_OPT_ROUTE_SRCADDR getsockopt - #14
Conversation
Add a new socket option MCTP_OPT_ROUTE_SRCADDR that allows applications to query which local EID the kernel would use as the source address when sending to a given destination EID. Applications such as PLDM need to advertise a local EID as the event receiver address to remote endpoints. Previously this required a manual multi-step lookup via the mctp tool (route show + addr show). The kernel routing table is the authoritative source for this mapping, so expose it directly via a socket option. The caller fills in net and daddr in struct mctp_route_srcaddr before calling getsockopt(SOL_MCTP, MCTP_OPT_ROUTE_SRCADDR); the kernel performs the same route lookup used for actual packet output and returns the resolved local EID in saddr. Signed-off-by: Faizan Ali <faizana@nvidia.com>
|
Was not sure which branch this PR needs to be targeted for, please let me know the right one. |
|
Patches for the kernel go to the kernel lists, we're not operating an upstream in this repo - it's mainly for our own development topics. However, I'm not convinced this new sockopt is the right way to go. Remember that any userspace-ABI-visible changes need to be supported permanently, so we need a solid rationale and design for this. So, my main question: how is this any better than picking an arbitrary locally-assigned EID? Also, I don't see how this relates to #8. |
I may have linked a different issue, this is the right one, CodeConstruct/mctp#147 |
This PR addresses requirements discussed in the issue CodeConstruct/mctp#147 and aims to
Add a new socket option MCTP_OPT_ROUTE_SRCADDR that allows applications to query which local EID the kernel would use as the source address when sending to a given destination EID.
Applications such as PLDM need to advertise a local EID as the event receiver address to remote endpoints.