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>
Showing the changes to include/uapi (1 of 5 files). Show all
Unified · Split
| @@ -11,6 +11,7 @@ · 10 unmodified lines | ||
| 11 | 11 | |
| 12 | 12 | #include <linux/types.h> |
| 13 | 13 | #include <linux/socket.h> |
| 14 | +#include <linux/netdevice.h> | |
| 14 | 15 | |
| 15 | 16 | typedef __u8 mctp_eid_t; |
| 16 | 17 | |
| @@ -28,6 +29,14 @@ struct sockaddr_mctp { · 11 unmodified lines | ||
| 28 | 29 | __u8 __smctp_pad1; |
| 29 | 30 | }; |
| 30 | 31 | |
| 32 | +struct sockaddr_mctp_ext { | |
| 33 | + struct sockaddr_mctp smctp_base; | |
| 34 | + int smctp_ifindex; | |
| 35 | + __u8 smctp_halen; | |
| 36 | + __u8 __smctp_pad0[3]; | |
| 37 | + __u8 smctp_haddr[MAX_ADDR_LEN]; | |
| 38 | +}; | |
| 39 | + | |
| 31 | 40 | #define MCTP_NET_ANY 0x0 |
| 32 | 41 | |
| 33 | 42 | #define MCTP_ADDR_NULL 0x00 |
| @@ -36,4 +45,6 @@ struct sockaddr_mctp { · 2 unmodified lines | ||
| 36 | 45 | #define MCTP_TAG_MASK 0x07 |
| 37 | 46 | #define MCTP_TAG_OWNER 0x08 |
| 38 | 47 | |
| 48 | +#define MCTP_OPT_ADDR_EXT 1 | |
| 49 | + | |
| 39 | 50 | #endif /* __UAPI_MCTP_H */ |