aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins/kernel_netlink
Commit message (Collapse)AuthorAgeFilesLines
* kernel-netlink: Don't set replay window for outbound SAsTobias Brunner2016-06-171-0/+6
| | | | | It's not necessary and might waste memory. However, if ESN is used we set the window to 1 as the kernel rejects the attribute otherwise.
* kernel-netlink: Install routes with OUT policiesTobias Brunner2016-06-101-25/+24
| | | | | This is the direction we actually need routes in and makes the code easier to read.
* kernel-netlink: Don't install routes for drop policies and if protocol/ports ↵Tobias Brunner2016-06-101-96/+106
| | | | | | | | | are in the selector We don't need them for drop policies and they might even mess with other routes we install. Routes for policies with protocol/ports in the selector will always be too broad and might conflict with other routes we install.
* kernel-netlink: Also use interface returned by get_nexthop() for IPsec policiesTobias Brunner2016-06-101-1/+2
|
* kernel-netlink: Use interface to next hop for shunt policiesTobias Brunner2016-06-101-10/+13
| | | | | | Using the source address to determine the interface is not correct for net-to-net shunts between two interfaces on which the host has IP addresses for each subnet.
* kernel-netlink: Return outbound interface in get_nexthop()Tobias Brunner2016-06-101-5/+43
|
* kernel-net: Let get_nexthop() return an optional interface nameTobias Brunner2016-06-102-7/+12
| | | | | The returned name should be the interface over which the destination address/net is reachable.
* kernel-netlink: Let only a single thread work on a specific policyTobias Brunner2016-06-101-25/+69
| | | | | | | | | | | | | Other threads are free to add/update/delete other policies. This tries to prevent race conditions caused by releasing the mutex while sending messages to the kernel. For instance, if break-before-make reauthentication is used and one thread on the responder is delayed in deleting the policies that another thread is concurrently adding for the new SA. This could have resulted in no policies being installed eventually. Fixes #1400.
* kernel-netlink: Add priority and refcount to policy logTobias Brunner2016-06-101-9/+30
|
* kernel-netlink: Consistently print mark in log messages only if setTobias Brunner2016-06-101-108/+82
|
* kernel-netlink: Provide error information for Netlink socketsTobias Brunner2016-06-103-19/+25
| | | | #1467.
* kernel-netlink: Allow definition of a custom priority calculation functionTobias Brunner2016-06-102-3/+18
|
* kernel-netlink: Use ipsec_sa_cfg_equals() and compare marks properlyTobias Brunner2016-06-081-2/+3
|
* kernel-netlink: Check proper watcher state in parallel modeTobias Brunner2016-05-061-1/+1
| | | | | | | | | | | | | After adding the read callback the state is WATCHER_QUEUED and it is switched to WATCHER_RUNNING only later by an asynchronous job. This means that a thread that sent a Netlink message shortly after registration might see the state as WATCHER_QUEUED. If it then tries to read the response and the watcher thread is quicker to actually read the message from the socket, it could block on recv() while still holding the lock. And the asynchronous job that actually read the message and tries to queue it will block while trying to acquire the lock, so we'd end up in a deadlock. This is probably mostly a problem in the unit tests.
* kernel-netlink: Order routes by prefix before comparing priority/metricTobias Brunner2016-05-061-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Metrics are basically defined to order routes with equal prefix, so ordering routes by metric first makes not much sense as that could prefer totally unspecific routes over very specific ones. For instance, the previous code did break installation of routes for passthrough policies with two routes like these in the main routing table: default via 192.168.2.1 dev eth0 proto static 192.168.2.0/24 dev eth0 proto kernel scope link src 192.168.2.10 metric 1 Because the default route has no metric set (0) it was used, instead of the more specific other one, to determine src and next hop when installing a route for a passthrough policy for 192.168.2.0/24. Therefore, the installed route in table 220 did then incorrectly redirect all local traffic to "next hop" 192.168.2.1. The same issue occurred when determining the source address while installing trap policies. Fixes 6b57790270fb ("kernel-netlink: Respect kernel routing priorities for IKE routes"). Fixes #1416.
* kernel-netlink: Order policies with equal priorities by their automatic priorityTobias Brunner2016-04-151-11/+24
| | | | | | | | | | | | This allows using manual priorities for traps, which have a lower base priority than the resulting IPsec policies. This could otherwise be problematic if, for example, swanctl --install/uninstall is used while an SA is established combined with e.g. IPComp, where the trap policy does not look the same as the IPsec policy (which is now otherwise often the case as the reqids stay the same). It also orders policies by selector size if manual priorities are configured and narrowing occurs.
* Extended IPsec kernel policy schemeAndreas Steffen2016-04-091-18/+53
| | | | | | | | The kernel policy now considers src and dst port masks as well as restictions to a given network interface. The base priority is 100'000 for passthrough shunts, 200'000 for IPsec policies, 300'000 for IPsec policy traps and 400'000 for fallback drop shunts. The values 1..30'000 can be used for manually set priorities.
* Implemented IPsec policies restricted to given network interfaceAndreas Steffen2016-04-091-6/+9
|
* Support manually-set IPsec policy prioritiesAndreas Steffen2016-04-091-2/+4
|
* kernel-netlink: Prefer policies with reqid over those withoutTobias Brunner2016-04-091-1/+7
| | | | | | | This allows two CHILD_SAs with reversed subnets to install two FWD policies each. Since the outbound policy won't have a reqid set we will end up with the two inbound FWD policies installed in the kernel, with the correct templates to allow decrypted traffic.
* kernel-netlink: Only associate templates with inbound FWD policiesTobias Brunner2016-04-091-1/+1
| | | | | | We can't set a template on the outbound FWD policy (or we'd have to make it optional). Because if the traffic does not come from another (matching) IPsec tunnel it would get dropped due to the template mismatch.
* kernel-netlink: Associate routes with IN policies instead of FWD policiesTobias Brunner2016-04-091-21/+21
| | | | | | This allows us to install more than one FWD policy. We already do this in the kernel-pfkey plugin (there the original reason was that not all kernels support FWD policies).
* kernel: Use structs to pass information to the kernel-ipsec interfaceTobias Brunner2016-04-091-215/+255
|
* Use standard unsigned integer typesAndreas Steffen2016-03-242-71/+71
|
* kernel-netlink: Fix lookup of next hops for destinations with prefixTobias Brunner2016-03-211-1/+2
| | | | References #1347.
* Implemented port ranges in kernel_netlink interfaceAndreas Steffen2016-03-041-7/+19
|
* libhydra: Move kernel interface to libcharonTobias Brunner2016-03-035-40/+33
| | | | This moves hydra->kernel_interface to charon->kernel.
* libhydra: Move all kernel plugins to libcharonTobias Brunner2016-03-0313-0/+7043
|
* Moved all kernel plugins to libhydra.Tobias Brunner2010-09-029-4327/+0
|
* Refer to kernel interface via hydra and not charon.Tobias Brunner2010-09-023-22/+26
|
* Removed references to protocol_id_t from kernel interface.Tobias Brunner2010-09-021-57/+22
| | | | | Instead we use the actual IP protocol identifier (the conversion now happens in child_sa_t and kernel_handler_t).
* Moved roam job creation to kernel event handler.Tobias Brunner2010-09-021-11/+23
|
* Refer to scheduler via hydra and not charon.Tobias Brunner2010-09-021-1/+1
|
* Moved migrate job creation to kernel event handler.Tobias Brunner2010-09-021-7/+2
|
* Moved update SA job creation to kernel event handler.Tobias Brunner2010-09-021-6/+2
|
* Moved delete/rekey CHILD_SA job creation to kernel event handler.Tobias Brunner2010-09-021-17/+4
|
* Moved acquire job creation to kernel event handler.Tobias Brunner2010-09-021-6/+3
|
* Some whitespace and code style fixes.Tobias Brunner2010-09-021-1/+1
|
* Refer to processor via hydra and not charon.Tobias Brunner2010-09-022-8/+10
|
* Use a seperate section for each nested struct member in INIT macroMartin Willi2010-08-181-14/+16
|
* support of xfrm marks for IKEv2Andreas Steffen2010-07-021-45/+278
|
* Respect line with in Makefile.am's, other cosmeticsMartin Willi2010-03-251-1/+2
|
* Changed all usages of lib->attributes to hydra->attributes.Tobias Brunner2010-03-241-1/+1
|
* Convert charon into libcharon.Tobias Brunner2010-03-191-1/+1
|
* Moving charon to libcharon.Tobias Brunner2010-03-199-0/+4133