aboutsummaryrefslogtreecommitdiffstats
path: root/src/libhydra/plugins/kernel_netlink/kernel_netlink_shared.c
Commit message (Collapse)AuthorAgeFilesLines
* libhydra: Move all kernel plugins to libcharonTobias Brunner2016-03-031-655/+0
|
* kernel-netlink: Use PAGE_SIZE as default size for the netlink receive bufferTobias Brunner2015-08-041-1/+11
| | | | | | | | The kernel uses NLMSG_GOODSIZE as default buffer size, which defaults to the PAGE_SIZE if it is lower than 8192 or to that value otherwise. In some cases (e.g. for dump messages) the kernel might use up to 16k for messages, which might require increasing this value.
* kernel-netlink: Actually verify if the netlink message exceeds the buffer sizeTobias Brunner2015-08-041-2/+2
| | | | | | It might equal it and that's fine. With MSG_TRUNC we get the actual message size and can only report an error if we haven't received the complete message.
* kernel-netlink: Make buffer size for received Netlink messages configurableTobias Brunner2015-05-211-7/+11
|
* kernel-netlink: Optionally ignore errors resulting from response message lossMartin Willi2014-11-211-0/+82
| | | | | | | | | | | | | | | As some backends over unreliable transport do not cache response messages, retransmissions due the loss of responses perform the operation again. Add an option to ignore some errors arising from such duplicate operations. Note: This approach can't distinguish between real EXIST/NOTFOUND errors and packet failures, and therefore is a source of race conditions and can't detect any of these errors actually happening. Therefore that behavior is disabled by default, and can be enabled with the ignore_retransmit_errors strongswan.conf option. To properly distinguish between real and retransmission errors, a Netlink backend should implement retransmission detection using sequence numbers.
* kernel-netlink: Add options to enable parallel Netlink queries explicitlyMartin Willi2014-11-211-5/+18
| | | | | | As under vanilla Linux the kernel can't handle parallel dump queries and returns EBUSY, it makes not much sense to use them. Disable parallel queries by default to basically restore original behavior, improving performance.
* kernel-netlink: Add a compile-time hook to simulate request message lossMartin Willi2014-11-211-0/+15
|
* kernel-netlink: Implement configurable Netlink request retransmissionMartin Willi2014-11-211-15/+86
|
* kernel-netlink: Retry netlink query while kernel returns EBUSYMartin Willi2014-11-211-3/+37
| | | | | | If the kernel can't execute a Netlink query because a different query is already active, it returns EBUSY. As this can happen now as we support parallel queries, retry on this error condition.
* kernel-netlink: Support parallel Netlink queriesMartin Willi2014-11-211-74/+192
| | | | | | | | | | | | | | | | | | Instead of locking the socket exclusively to wait for replies, use watcher to wait for and read in responses asynchronously. This allows multiple parallel Netlink queries, which can significantly improve performance if the kernel Netlink layer has longer latencies and supports parallel queries. For vanilla Linux, parallel queries don't make much sense, as it usually returns EBUSY for the relevant dump requests. This requires a retry, and in the end makes queries more expensive under high load. Instead of checking the Netlink message sequence number to detect multi-part messages, this code now relies on the NLM_F_MULTI flag to detect them. This has previously been avoided (by 1d51abb7). It is unclear if the flag did not work correctly on very old Linux kernels, or if the flag was not used appropriately by strongSwan. The flag seems to work just fine back to 2.6.18, which is a kernel still in use by RedHat/CentOS 5.
* kernel-netlink: Pass protocol specific enum names to socket constructorMartin Willi2014-09-241-8/+8
| | | | | This avoid the hard dependency on enum names, and makes kernel_netlink_shared independent of kernel_netlink_ipsec.
* kernel-netlink: Clean up socket initialization, handle 0 as valid socket fdMartin Willi2014-09-241-9/+6
|
* kernel-netlink: Clean up response buffer managementMartin Willi2014-09-241-24/+16
|
* kernel-netlink: Use recv() instead of recvfrom()Martin Willi2014-09-241-11/+3
| | | | | As we are not interested in the returned address, there is really no need in passing that argument.
* kernel-netlink: Avoid casting the NLMSG_DATA() return valueMartin Willi2014-09-241-1/+1
| | | | There is really no need for doing so, and it makes the code just unreadable.
* Add a Netlink utility function to add a RTA header and reserve space for dataMartin Willi2013-03-151-0/+21
|
* Correctly check buffer length in netlink_add_attribute()Martin Willi2013-03-151-1/+1
|
* Moved debug.[ch] to utils folderTobias Brunner2012-10-241-1/+1
|
* Be less verbose when deleting SAs triggered by a hard expireMartin Willi2012-03-201-0/+5
|
* Migrated netlink_socket to INIT/METHOD macrosAndreas Steffen2011-09-291-23/+18
|
* Moved all kernel plugins to libhydra.Tobias Brunner2010-09-021-0/+306