git: 9df901c8f8c8 - main - netlink: Pop NLMSG_ALIGNTO and NLMSG_ALIGN out of the #ifndef _KERNEL block
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 10 Dec 2024 18:13:00 UTC
The branch main has been updated by arrowd: URL: https://cgit.FreeBSD.org/src/commit/?id=9df901c8f8c8f6a0766d87fbc6ef3dc1b73423f8 commit 9df901c8f8c8f6a0766d87fbc6ef3dc1b73423f8 Author: Gleb Popov <arrowd@FreeBSD.org> AuthorDate: 2024-10-31 16:23:23 +0000 Commit: Gleb Popov <arrowd@FreeBSD.org> CommitDate: 2024-12-10 18:12:09 +0000 netlink: Pop NLMSG_ALIGNTO and NLMSG_ALIGN out of the #ifndef _KERNEL block Sponsored by: Future Crew, LLC Approved by: melifaro Differential Revision: https://reviews.freebsd.org/D47333 --- sys/netlink/netlink.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/netlink/netlink.h b/sys/netlink/netlink.h index e677365b9a21..a87363197187 100644 --- a/sys/netlink/netlink.h +++ b/sys/netlink/netlink.h @@ -205,11 +205,12 @@ enum nlmsginfo_attrs { #define NL_ITEM_ITER(_ptr, _len, _LEN_MACRO) \ ((_len) -= _LEN_MACRO(_ptr), NL_ITEM_NEXT(_ptr, _LEN_MACRO)) - -#ifndef _KERNEL /* part of netlink(3) API */ #define NLMSG_ALIGNTO NL_ITEM_ALIGN_SIZE #define NLMSG_ALIGN(_len) NL_ITEM_ALIGN(_len) + +#ifndef _KERNEL +/* part of netlink(3) API */ #define NLMSG_HDRLEN (sizeof(struct nlmsghdr)) #define NLMSG_LENGTH(_len) ((_len) + NLMSG_HDRLEN) #define NLMSG_SPACE(_len) NLMSG_ALIGN(NLMSG_LENGTH(_len)) @@ -221,8 +222,6 @@ enum nlmsginfo_attrs { #define NLMSG_NEXT(_hdr, _len) NL_ITEM_ITER(_hdr, _len, _NLMSG_ALIGNED_LEN) #else -#define NLMSG_ALIGNTO 4U -#define NLMSG_ALIGN(len) (((len) + NLMSG_ALIGNTO - 1) & ~(NLMSG_ALIGNTO - 1)) #define NLMSG_HDRLEN (NLMSG_ALIGN(sizeof(struct nlmsghdr))) #endif