aboutsummaryrefslogtreecommitdiffstats
path: root/src/libhydra/plugins/kernel_netlink
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2016-02-12 15:08:34 +0100
committerTobias Brunner <tobias@strongswan.org>2016-02-12 15:08:34 +0100
commit70934d94367d485cb599071671941b5d0c5c19fb (patch)
tree05076fd7433545062600888ff77718a29fe10998 /src/libhydra/plugins/kernel_netlink
parent10c5981d3bbba891cd1786eacc7d11df18825f9e (diff)
downloadstrongswan-70934d94367d485cb599071671941b5d0c5c19fb.tar.bz2
strongswan-70934d94367d485cb599071671941b5d0c5c19fb.tar.xz
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.
Diffstat (limited to 'src/libhydra/plugins/kernel_netlink')
-rw-r--r--src/libhydra/plugins/kernel_netlink/kernel_netlink_shared.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/libhydra/plugins/kernel_netlink/kernel_netlink_shared.h b/src/libhydra/plugins/kernel_netlink/kernel_netlink_shared.h
index 66682907d..b034326d7 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 <linux/rtnetlink.h>
/**
+ * 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;