mctp: Implement extended addressing
authorJeremy Kerr <jk@codeconstruct.com.au>
Tue, 26 Oct 2021 01:57:28 +0000 (09:57 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 26 Oct 2021 13:58:45 +0000 (14:58 +0100)
commit99ce45d5e7dbde399997a630f45ac9f654fa4bcc
tree90da8fa27361a3ff0eba69e8a074a921d99f049f
parent971f5c4079ed46a131ad3ac6e684ed056a7777da
mctp: Implement extended addressing

This change allows an extended address struct - struct sockaddr_mctp_ext
- to be passed to sendmsg/recvmsg. This allows userspace to specify
output ifindex and physical address information (for sendmsg) or receive
the input ifindex/physaddr for incoming messages (for recvmsg). This is
typically used by userspace for MCTP address discovery and assignment
operations.

The extended addressing facility is conditional on a new sockopt:
MCTP_OPT_ADDR_EXT; userspace must explicitly enable addressing before
the kernel will consume/populate the extended address data.

Includes a fix for an uninitialised var:
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/socket.h
include/net/mctp.h
include/uapi/linux/mctp.h
net/mctp/af_mctp.c
net/mctp/route.c