kernel-netlink: Define netlink buffer as an union having a netlink header

This allows us to streamline the netlink buffers, and avoid extensive
casting.
This commit is contained in:
Martin Willi
2014-09-24 11:19:58 +02:00
parent 6fe02dda75
commit 0404a29bfe
4 changed files with 24 additions and 21 deletions
@@ -26,7 +26,10 @@
* 1024 byte is currently sufficient for all operations. Some platform
* require an enforced aligment to four bytes (e.g. ARM).
*/
typedef u_char netlink_buf_t[1024] __attribute__((aligned(RTA_ALIGNTO)));
typedef union {
struct nlmsghdr hdr;
u_char bytes[1024];
} netlink_buf_t __attribute__((aligned(RTA_ALIGNTO)));
typedef struct netlink_socket_t netlink_socket_t;