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
48 * @nlmsg_flags: Additional flags48 * @nlmsg_flags: Additional flags
49 * @nlmsg_seq: Sequence number49 * @nlmsg_seq: Sequence number
50 * @nlmsg_pid: Sending process port ID50 * @nlmsg_pid: Sending process port ID
51 * @nlmsg_data: Message payload
52 */51 */
53struct nlmsghdr {52struct 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 */