Clean up the use of unsafe_memcpy() by adding a flexible array at the end of netlink message header and splitting up the header and data copies.
Showing the changes to include/uapi (1 of 3 files). Show all
Unified · Split
| @@ -48,6 +48,7 @@ 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 | ||
| 51 | */ | 52 | */ |
| 52 | struct nlmsghdr { | 53 | struct nlmsghdr { |
| 53 | __u32 nlmsg_len; | 54 | __u32 nlmsg_len; |
| @@ -55,6 +56,7 @@ struct nlmsghdr { · 1 unmodified line | |||
| 55 | __u16 nlmsg_flags; | 56 | __u16 nlmsg_flags; |
| 56 | __u32 nlmsg_seq; | 57 | __u32 nlmsg_seq; |
| 57 | __u32 nlmsg_pid; | 58 | __u32 nlmsg_pid; |
| 59 | __u8 nlmsg_data[]; | ||
| 58 | }; | 60 | }; |
| 59 | 61 | ||
| 60 | /* Flags values */ | 62 | /* Flags values */ |