I've added a flex array to struct nlmsghdr in commit 738136a0e375 ("netlink: split up copies in the ack construction") to allow accessing the data easily. It leads to warnings with clang, if user space wraps this structure into another struct and the flex array is not at the end of the container.
Showing the changes to include/uapi (1 of 2 files). Show all
Unified · Split
| @@ -48,7 +48,6 @@ struct sockaddr_nl { · 47 unmodified lines | |||
| 48 | * @nlmsg_flags: Additional flags | 48 | * @nlmsg_flags: Additional flags |
| 49 | * @nlmsg_seq: Sequence number | 49 | * @nlmsg_seq: Sequence number |
| 50 | * @nlmsg_pid: Sending process port ID | 50 | * @nlmsg_pid: Sending process port ID |
| 51 | * @nlmsg_data: Message payload | ||
| 52 | */ | 51 | */ |
| 53 | struct nlmsghdr { | 52 | struct nlmsghdr { |
| 54 | __u32 nlmsg_len; | 53 | __u32 nlmsg_len; |
| @@ -56,7 +55,6 @@ struct nlmsghdr { · 1 unmodified line | |||
| 56 | __u16 nlmsg_flags; | 55 | __u16 nlmsg_flags; |
| 57 | __u32 nlmsg_seq; | 56 | __u32 nlmsg_seq; |
| 58 | __u32 nlmsg_pid; | 57 | __u32 nlmsg_pid; |
| 59 | __u8 nlmsg_data[]; | ||
| 60 | }; | 58 | }; |
| 61 | 59 | ||
| 62 | /* Flags values */ | 60 | /* Flags values */ |