kernel-netlink: Define netlink buffer as an union having a netlink header
[strongswan.git] / src / libhydra / plugins / kernel_netlink / kernel_netlink_shared.h
index 8be935b..1a03a89 100644 (file)
  * 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;