History

netlink: remove the flex array from struct nlmsghdr

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.

Jakub Kicinski committed 3 years ago

Commit c73a72f1 parent ab037782 files · +1 −3Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/linux/netlink.h+0−2
@@ -48,7 +48,6 @@ struct sockaddr_nl { · 47 unmodified lines
4848 * @nlmsg_flags: Additional flags
4949 * @nlmsg_seq: Sequence number
5050 * @nlmsg_pid: Sending process port ID
51− * @nlmsg_data: Message payload
5251 */
5352 struct nlmsghdr {
5453 __u32 nlmsg_len;
@@ -56,7 +55,6 @@ struct nlmsghdr { · 1 unmodified line
5655 __u16 nlmsg_flags;
5756 __u32 nlmsg_seq;
5857 __u32 nlmsg_pid;
59− __u8 nlmsg_data[];
6058 };
6159
6260 /* Flags values */