aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/networking
Commit message (Collapse)AuthorAgeFilesLines
* streams: Remove registered systemd stream serviceTobias Brunner2017-10-181-0/+3
| | | | Fixes: 59db98fb941c ("stream: Add basic stream service for systemd sockets")
* streams: Named systemd sockets are only supported since systemd v227Tobias Brunner2017-10-131-0/+6
|
* stream: Add basic stream service for systemd socketsaszlig2017-10-103-0/+111
| | | | | | | | | | | | | | | | | | | | | | | | This allows systemd socket activation by passing URIs such as systemd://foo to plugins such as VICI. For example setting charon.plugins.vici.socket = systemd://vici, a systemd socket file descriptor with the name "vici" will be picked up. So these would be the corresponding unit options: [Socket] FileDescriptorName=vici Service=strongswan.service ListenStream=/run/charon.vici The implementation currently is very basic and right now only the first file descriptor for a particular identifier is picked up if there are multiple socket units with the same FileDescriptorName. Signed-off-by: aszlig <aszlig@redmoonstudios.org> Closes strongswan/strongswan#79.
* tun-device: Use next free TUN device on FreeBSDTobias Brunner2017-05-191-3/+18
| | | | | | | | | | | While this API is documented as legacy (and there is a sysctl option to disable it) the documentation also mentions that it will probably stay enabled by default due to compatibility issues with existing applications. With the previous approach only 255 devices could be opened then the daemon had to be restarted. Fixes #2313.
* tun-device: TUN devices are not supported on iOSTobias Brunner2017-05-191-1/+10
|
* host: Don't log port if it is zeroTobias Brunner2017-03-021-1/+1
|
* Use standard unsigned integer typesAndreas Steffen2016-03-246-31/+31
|
* host: Properly handle NULL in host_create_from_string[_and_family]Tobias Brunner2015-07-271-0/+4
|
* host-resolver: Do not cancel threads waiting for new queries during cleanupMartin Willi2015-02-241-6/+8
| | | | | | | | | | | | | | | | While it is currently unclear why it happens, canceling threads waiting in the new_query condvar does not work as expected. The behavior is not fully reproducible: Either cancel(), join() or destroying the condvar hangs. The issue has been seen in the http-fetcher unit tests, where the stream service triggers the use of the resolver for "localhost" hosts. It is reproducible with any cleanup following a host_create_from_dns() use on a Ubuntu 14.04 x64 system. Further, the issue is related to the use of libunwind, as only builds with --enable-unwind-backtraces are affected. As we broadcast() the new_query condvar before destruction, a hard cancel() of these threads is actually not required. Instead we let these threads clean up themselves after receiving the condvar signal.
* host-resolver: Disable resolver thread cancellation by defaultMartin Willi2015-02-241-0/+3
| | | | | The default of new threads is cancellable, but the host-resolver thread code clearly expects the opposite.
* apple: Redefine some additional clashing Mach typesMartin Willi2014-12-161-3/+3
| | | | | | While they usually are not included in a normal strongSwan build, the XPC header indirectly defines these Mach types. To build charon-xpc, which uses both XPC and strongSwan includes, we have to redefine these types.
* tun-device: Read from tun to buffer on stack to avoid over-allocation of packetsMartin Willi2014-11-211-8/+6
| | | | | | | Instead of allocating MTU-sized buffers for each packet, read to a stack buffer and copy to an allocation of the actual packet size. While it requires an additional copy on non-Apple platforms, this should make allocation more efficient for small packets.
* tun-device: Remove the superfluous use of select() before read()Martin Willi2014-11-212-19/+6
|
* host: Ignore spaces around - when parsing rangesTobias Brunner2014-10-302-7/+15
|
* host: Add function to create two hosts from a range definitionTobias Brunner2014-10-302-0/+41
|
* packet: Define a global default maximum size for IKE packetsTobias Brunner2014-10-101-0/+5
|
* stream-service: Prevent race conditions due to blocking call to destroy()Tobias Brunner2014-09-091-5/+62
| | | | | | | | In the previous implementation queued jobs could prevent a service from getting destroyed. This could have lead to a deadlock when the processor is cancelled. Now destroy() still blocks, but waits only for actually running tasks. The service instance is reference counted so that queued jobs can safely be destroyed.
* stream-service: Do not accept or re-register when service is terminatedTobias Brunner2014-09-091-2/+10
|
* stream-service: Restart accepting without blockingTobias Brunner2014-09-091-2/+7
| | | | | | | | | | | | Calling on_accept() sometimes lead to deadlocks when service->destroy() was called concurrently. That is, two threads waiting in on_accept() but the last worker would only wake one due to the call to signal(). Calling broadcast() wouldn't help either as that could lead to crashes if the thread that called destroy() is woken first. This is also more efficient as a constant pool of concurrent workers can be maintained, otherwise peaks at the limit were followed by only a single worker being active.
* stream: Separate TCP/Unix stream helpers from stream/service implementationsMartin Willi2014-06-0413-300/+503
| | | | | | This allows us to disable Unix sockets cleanly on Windows. Replaces some read/write calls with recv/send counterparts, as Winsock does not like read/writes.
* tun-device: Rearrange headers to build properly when tun devices not supportedMartin Willi2014-06-031-19/+13
|
* windows: Add a common Windows header for platform specific wrappersMartin Willi2014-06-032-5/+1
| | | | | Include some more basic system headers in utils.h, so we can use that common header on the different platforms.
* tun-device: Use SIOCAIFADDR to set IP address on FreeBSD 10Tobias Brunner2014-04-251-2/+90
| | | | | | | | FreeBSD 10 deprecated the SIOCSIFADDR etc. commands, so we use this newer command to set the address and netmask. A destination address is now also required. Fixes #566.
* lookip: Disconnect asynchronously to avoid dead-locking watcher unregistrationMartin Willi2014-02-171-3/+2
| | | | | | | | | While it really would be desirable to allow stream destruction during on_read() callbacks, this does not work anymore since e49b2998. Until we have a proper solution for this issue, use asynchronous disconnects for the only user doing so. Fixes #518.
* lib: All settings use configured namespaceTobias Brunner2014-02-121-4/+4
|
* stream: Make sure no watcher callback is active while changing stream callbacksMartin Willi2014-01-221-14/+3
| | | | | | | | | | | When changing async callbacks on streams, we have to make sure the watcher callback is not currently active and has temporarily disabled callbacks. This could have been the case, as we didn't explicitly removed any pending watcher registration if both callbacks are NULL. By enforcing the watcher unregistration, we are sure the watcher callback is not active and currently is not mangling the callback hooks. This should make sure we avoid any races for the callback variables.
* tun-device: Include system headers before our ownTobias Brunner2013-12-202-3/+5
| | | | | | | | | | | | | On CentOS 6.5 the sys/capability.h header file defines _LINUX_TYPES_H without actually including that header, preventing its later inclusion here. As library.h (via which the capabilities headers are included) is not actually required in tun_device.[ch], moving the inclusion of tun_device.h would not strictly be necessary. But it's probably a good idea to include our own headers after system headers anyway, for if one of the recursively included files at a later point includes library.h we'd have the same problem again.
* tun-device: Include <linux/types.h> before <linux/if_tun.h>Martin Willi2013-11-221-0/+1
| | | | Fixes a build error on CentOS 6.4.
* Use exact mask when calling umask(2)Tobias Brunner2013-10-291-1/+1
| | | | | | Due to the previous negation the high bits of the mask were set, which at least some versions of the Android build system prevent with a compile-time check.
* tun_device: Add warning if TUN devices are not supported by platformTobias Brunner2013-09-121-2/+16
|
* host: Properly initialize struct sockaddr_in[6] when parsing stringsTobias Brunner2013-07-311-0/+2
| | | | | Otherwise struct members like sin6_flowinfo or sin6_scope_id might be set to bogus values.
* stream: Ensure UNIX socket path is null terminatedTobias Brunner2013-07-241-0/+1
|
* host: Prevent overflow in host_create_netmask() if mask is 0 or 32/128Tobias Brunner2013-07-241-5/+7
|
* Fix various API doc issues and typosTobias Brunner2013-07-181-2/+3
| | | | Partially based on an old patch by Adrian-Ken Rueegsegger.
* stream-service: move CAP_CHOWN check from plugins to service constructorMartin Willi2013-07-181-0/+5
| | | | | A plugin service can be a TCP socket now, so it does not make much sense to strictly check for CAP_CHOWN.
* stream: allow async read/write callback to destroy the stream explicitlyMartin Willi2013-07-182-10/+15
|
* stream: don't close underlying socket when creating a stream from itMartin Willi2013-07-181-1/+6
|
* stream: support keeping the service alive outside of service callbackMartin Willi2013-07-182-4/+5
|
* stream: add read/write_all() methods to streamMartin Willi2013-07-182-2/+73
|
* stream: support cancellation of stream service callbackMartin Willi2013-07-181-2/+3
|
* stream: use a service constructor to create servicesMartin Willi2013-07-182-77/+8
| | | | | | It does not make much sense to reference running services in the manager, especially as unregistration would need the URI (which a user would have to store instead of the service reference).
* stream: replace print/vprint() convenience functions by a FILE* getterMartin Willi2013-07-182-51/+20
| | | | | While this will complicate the implementation of streams not based on a fd, it allows us to unleash the full power of FILE based convenience functions.
* stream: add a concurrency option to services, limiting parallel callbacksMartin Willi2013-07-184-7/+71
|
* stream: add a job priority option to stream servicesMartin Willi2013-07-184-7/+24
|
* stream: add backlog option to stream services, forward to listen()Martin Willi2013-07-184-11/+15
|
* stream: add support for TCP stream servicesMartin Willi2013-07-183-0/+53
|
* stream: add support for TCP streamsMartin Willi2013-07-183-2/+108
|
* stream: add support for UNIX stream servicesMartin Willi2013-07-183-0/+61
|
* stream: add support for UNIX streamsMartin Willi2013-07-183-0/+77
|
* stream: support async operation using watcherMartin Willi2013-07-182-0/+142
|