net: mctp: Allow limiting binds to a peer address
authorMatt Johnston <matt@codeconstruct.com.au>
Thu, 10 Jul 2025 08:55:59 +0000 (16:55 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 15 Jul 2025 10:08:39 +0000 (12:08 +0200)
commit3549eb08e5505823857838b5cf5f08567702d054
tree7ee13fd8d58056b4616ecb94d4b96ee31066fa09
parent1aeed732f4f885ad36280ca4afb331fa42bf7263
net: mctp: Allow limiting binds to a peer address

Prior to calling bind() a program may call connect() on a socket to
restrict to a remote peer address.

Using connect() is the normal mechanism to specify a remote network
peer, so we use that here. In MCTP connect() is only used for bound
sockets - send() is not available for MCTP since a tag must be provided
for each message.

The smctp_type must match between connect() and bind() calls.

Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
Link: https://patch.msgid.link/20250710-mctp-bind-v4-6-8ec2f6460c56@codeconstruct.com.au
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
include/net/mctp.h
net/mctp/af_mctp.c
net/mctp/route.c