Commit Graph
228 Commits
Author SHA1 Message Date
Tobias Brunner bef21bd330 Algorithm names are not always static anymore, avoid string overflows 2012-09-28 16:49:05 +02:00
Tobias Brunner a79af394a0 Allow replay windows smaller than the default of 32 2012-09-27 12:43:39 +02:00
Tobias Brunner 9845391a95 Properly initialize cached address map in kernel-pfroute plugin 2012-09-27 12:43:36 +02:00
Tobias Brunner bfd2cc1cd7 Fixed compilation of kernel-pfroute plugin 2012-09-27 09:23:58 +02:00
Tobias Brunner 2e2feffb67 Don't check interface of inbound message if interfaces are not filtered
We don't have a proper kernel-net interface on Android yet, so the check
for a usable interface does not work there.
2012-09-24 17:12:18 +02:00
Tobias Brunner f65ec0aa90 Make sure the if_name member of cached route entries is initialized to NULL 2012-09-22 08:23:56 +02:00
Tobias Brunner bdf36dac71 Use an rwlock in kernel-pfroute too 2012-09-21 18:16:27 +02:00
Tobias Brunner a25d536eea Use rwlock and rwlock_condvar to increase concurrency in kernel-netlink plugin 2012-09-21 18:16:27 +02:00
Tobias Brunner 16d62305c2 Use a separate mutex for cached routes in kernel-netlink plugin 2012-09-21 18:16:27 +02:00
Tobias Brunner 4134108c77 Use a lock to safely check and update the time for the next roam event 2012-09-21 18:16:27 +02:00
Tobias Brunner e8e9048fee Added an option to configure the interface on which virtual IP addresses are installed 2012-09-21 18:16:26 +02:00
Tobias Brunner c6b401581a Changed how kernel-netlink handles virtual IP addresses
Also tried to avoid the use of enumerators.
2012-09-21 18:16:26 +02:00
Tobias Brunner 4106aea8e4 Made IP address enumeration more flexible
Also added an option to enumerate addresses on ignored interfaces.
2012-09-21 18:16:26 +02:00
Tobias Brunner 1f97e1aaca Use a hashtable to quickly check for usable IP addresses/interfaces 2012-09-21 18:16:26 +02:00
Tobias Brunner 940e1b0f66 Filter ignored interfaces in kernel interfaces (for events, address enumeration, etc.) 2012-09-21 18:16:26 +02:00
Tobias Brunner 645d7a5ef3 %any is never on a local interface 2012-09-21 18:16:26 +02:00
Tobias Brunner 9ba36c0f7f Make it easy to check if an address is locally usable via changed get_interface() method 2012-09-21 18:16:26 +02:00
Tobias Brunner aed33805ce Don't ignore loopback devices and allow addresses on them being enumerated 2012-09-21 18:16:26 +02:00
Tobias Brunner 9513225e6b Added options and a lookup function that will allow filtering of network interfaces 2012-09-21 18:16:26 +02:00
Tobias Brunner dad6d904ee Use source address in get_nexthop() call
Otherwise the nexthop returned might belong to a different route than
the one actually used with the current source address.
2012-09-21 18:16:25 +02:00
Tobias Brunner 662534657f Source address lookup refactored
Routes matching the destination are now first parsed and sorted by network
prefix length.  This list is then used to search for the best route with
a matching preferred source address (if one is specified).  This makes sure
we really check all routes for that address.
2012-09-21 18:16:25 +02:00
Tobias Brunner cef0a8118e Check routes with equal prefix if preferred source is specified 2012-09-21 18:16:25 +02:00
Tobias Brunner 9d6b02d6c1 Try to find preferred source on interface if returned source does not match 2012-09-21 18:16:25 +02:00
Tobias Brunner da6d86dd94 Try to keep the given source address when looking up routes
This allows to pin the local end of an IKE_SA to an address that is not the
physical address of an interface.  Without this patch the local address would
change to the physical address when roam events occur.
2012-09-21 18:16:25 +02:00
Martin Willi f0a2fef8a5 In mem_pool, check for an existing ID entry before creating a new one 2012-09-20 11:04:55 +02:00
Tobias Brunner 08ad639f32 Added algorithm lookup via kernel_interface_t to the various kernel interfaces 2012-09-13 15:48:49 +02:00
Tobias Brunner 524fb37ccd Added possibility to register custom kernel algorithms to kernel interface 2012-09-13 15:44:47 +02:00
Tobias Brunner fa96a350c2 Consistently log XFRM mark masks with 0 prefix in kernel-netlink plugin 2012-09-12 17:40:36 +02:00
Martin Willi 5b96503e13 Use uintptr_t in mem pool to avoid compiler warning if sizeof(void*) != sizeof(int) 2012-09-12 13:19:52 +02:00
Martin Willi 1e04488f32 Check for an existing lease in all stroke pools before creating a new one 2012-09-11 16:18:28 +02:00
Martin Willi 28a3d5bfbd Pass full pool list to release_address 2012-09-11 16:18:28 +02:00
Martin Willi 594c58e111 Pass the full list of pools to acquire_address, enumerate in providers
If the provider has access to the full pool list, it can enumerate
them twice, for example to search for existing leases first, and
only search for new leases in a second step.

Fixes lease enumeration in attr-sql using multiple pools.
2012-09-11 16:18:28 +02:00
Tobias Brunner 4065e2504c Use the proper types for comma separated attributes read from strongswan.conf
Attributes of different address families previously were mapped to
the same attribute type (the one derived from the address family of the
first address).
2012-09-10 15:17:17 +02:00
Tobias Brunner 747fd544a7 Properly remove broadcast address from mem pools 2012-09-10 11:44:18 +02:00
Martin Willi 7f52f621c2 Be less verbose if IP allocation for a single pool fails 2012-08-30 16:43:44 +02:00
Martin Willi 40e9089889 Strictly enforce address family match while acquiring mem_pool IPs 2012-08-30 16:43:44 +02:00
Martin Willi 13f11ccf46 Don't parse comma separated pool names in attr-sql
We now handle multiple pools at a deeper level, making that special
handling obsolete. Comma separated pools are parsed in stroke.
2012-08-30 16:43:44 +02:00
Martin Willi d55fe264d1 Pass all configured pool names to attribute provider enumerator 2012-08-30 16:43:43 +02:00
Martin Willi feb8550401 Pass a list instead of a single virtual IP to attribute enumerators 2012-08-30 16:43:42 +02:00
Martin Willi 497ce2cf51 Support multiple address pools configured on a peer_cfg 2012-08-30 16:43:42 +02:00
Martin Willi d8eec395b2 Add a getter for the mem_pool_t base address 2012-08-24 11:19:07 +02:00
Tobias Brunner 31a0e24b0f Increased log level when listing interfaces and IP addresses during startup
This avoids confusing log messages in starter and ipsec statusall
already lists the available addresses anyway.
2012-08-16 16:14:15 +02:00
Tobias Brunner 3a917ac77f Validate netmask in mem_pool_create 2012-08-13 13:54:28 +02:00
Tobias Brunner 156f7e9b85 Moved types used by kernel_ipsec_t interface (and libipsec) to libstrongswan
This avoids a dependency of libipsec to libhydra.
2012-08-08 15:41:02 +02:00
Tobias Brunner e49abcede0 Let kernel interfaces decide how to enable UDP decapsulation of ESP packets. 2012-08-08 15:12:24 +02:00
Martin Willi 3b7468b245 Support Unity split-include/exclude options in attr plugin 2012-07-20 17:36:27 +02:00
Tobias Brunner 0159a54047 Check rng return value when generating SPIs in kernel-klips plugin 2012-07-16 14:53:36 +02:00
Tobias Brunner 63afd833b9 Avoid SIGSEGV during shutdown if charon is not started as root 2012-06-25 19:00:00 +02:00
Tobias Brunner 26d77eb3e6 Centralized thread cancellation in processor_t
This ensures that no threads are active when plugins and the rest of the
daemon are unloaded.

callback_job_t was simplified a lot in the process as its main
functionality is now contained in processor_t.  The parent-child
relationships were abandoned as these were only needed to simplify job
cancellation.
2012-06-25 17:38:59 +02:00
Tobias Brunner 7beb31aae4 Fixed IPv6 source address lookup
Because Linux kernels prior to 3.0 do not support RTA_PREFSRC for
IPv6 routes we didn't use NLM_F_DUMP to get all routes.
Still routes installed with policies are installed also for IPv6.
So since only one route is returned without DUMP, and we ignore
all routes from our own routing table, no source address was found
during roaming if DST of the installed route included the IKE peer.

With newer kernels we can now use DUMP as we did for IPv4 already,
for older kernels we do so if our own routes are installed in a
separate routing table, otherwise we still use GET.
2012-06-25 16:29:59 +02:00