diff options
| author | Gleb Popov <arrowd@FreeBSD.org> | 2024-10-31 16:23:23 +0000 |
|---|---|---|
| committer | Gleb Popov <arrowd@FreeBSD.org> | 2024-12-10 18:12:09 +0000 |
| commit | 9df901c8f8c8f6a0766d87fbc6ef3dc1b73423f8 (patch) | |
| tree | a96fa3d322ffb6f03499098964a50006d95ae919 | |
| parent | c7919fb92d201ab1d5bd3ab0c18cbcea961ef761 (diff) | |
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
| -rw-r--r-- | sys/netlink/netlink.h | 7 |
1 files 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 |
