From: Tobias Brunner Date: Fri, 12 Feb 2016 14:08:34 +0000 (+0100) Subject: kernel-netlink: Allow Netlink send buffer size to be configured via compile option X-Git-Tag: 5.4.0dr6~3 X-Git-Url: https://git.strongswan.org/?p=strongswan.git;a=commitdiff_plain;h=70934d94367d485cb599071671941b5d0c5c19fb kernel-netlink: Allow Netlink send buffer size to be configured via compile option The receive buffer size can already be changed via strongswan.conf if necessary. --- diff --git a/src/libhydra/plugins/kernel_netlink/kernel_netlink_shared.h b/src/libhydra/plugins/kernel_netlink/kernel_netlink_shared.h index 6668290..b034326 100644 --- a/src/libhydra/plugins/kernel_netlink/kernel_netlink_shared.h +++ b/src/libhydra/plugins/kernel_netlink/kernel_netlink_shared.h @@ -21,14 +21,22 @@ #include /** + * Default buffer size. + * + * 1024 byte is currently sufficient for all operations. + */ +#ifndef KERNEL_NETLINK_BUFSIZE +#define KERNEL_NETLINK_BUFSIZE 1024 +#endif + +/** * General purpose netlink buffer. * - * 1024 byte is currently sufficient for all operations. Some platform - * require an enforced aligment to four bytes (e.g. ARM). + * Some platforms require an enforced aligment to four bytes (e.g. ARM). */ typedef union { struct nlmsghdr hdr; - u_char bytes[1024]; + u_char bytes[KERNEL_NETLINK_BUFSIZE]; } netlink_buf_t __attribute__((aligned(RTA_ALIGNTO))); typedef struct netlink_socket_t netlink_socket_t;