NLMSG_HDRLEN is already aligned value. It's for directly reference without extra alignment. The redundant alignment here may confuse the API users.
Showing the changes to include/uapi/linux (1 of 1 file). Show all
Unified · Split
| @@ -78,7 +78,7 @@ struct nlmsghdr { · 77 unmodified lines | |||
| 78 | #define NLMSG_ALIGNTO 4U | 78 | #define NLMSG_ALIGNTO 4U |
| 79 | #define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) ) | 79 | #define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) ) |
| 80 | #define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr))) | 80 | #define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr))) |
| 81 | #define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(NLMSG_HDRLEN)) | 81 | #define NLMSG_LENGTH(len) ((len) + NLMSG_HDRLEN) |
| 82 | #define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len)) | 82 | #define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len)) |
| 83 | #define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0))) | 83 | #define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0))) |
| 84 | #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \ | 84 | #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \ |