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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user