strongswan.git
5 years agostarter: Add starter group and fix formatting of conf_parser_section_t enum
Tobias Brunner [Tue, 24 Jun 2014 14:10:14 +0000 (16:10 +0200)]
starter: Add starter group and fix formatting of conf_parser_section_t enum

Make use of the Markdown support in recent Doxygen versions.

5 years agoswanctl: Fix Doxygen group assignment
Tobias Brunner [Tue, 24 Jun 2014 14:09:09 +0000 (16:09 +0200)]
swanctl: Fix Doxygen group assignment

5 years agoapidoc: Updated Doxyfile.in
Tobias Brunner [Tue, 24 Jun 2014 14:03:16 +0000 (16:03 +0200)]
apidoc: Updated Doxyfile.in

5 years agoFixed some typos
Tobias Brunner [Tue, 24 Jun 2014 13:57:15 +0000 (15:57 +0200)]
Fixed some typos

5 years agoUpdate KVM test framework to 3.15 guest kernel 5.2.0rc1
Andreas Steffen [Fri, 27 Jun 2014 08:07:27 +0000 (10:07 +0200)]
Update KVM test framework to 3.15 guest kernel

5 years agoAdded Android 4.4.4 to IMV database
Andreas Steffen [Fri, 27 Jun 2014 06:27:23 +0000 (08:27 +0200)]
Added Android 4.4.4 to IMV database

5 years agotesting: Add sql/shunt-policies-nat-rw scenario
Tobias Brunner [Thu, 26 Jun 2014 16:11:23 +0000 (18:11 +0200)]
testing: Add sql/shunt-policies-nat-rw scenario

5 years agotesting: Add pfkey/shunt-policies-nat-rw scenario
Tobias Brunner [Thu, 26 Jun 2014 13:46:39 +0000 (15:46 +0200)]
testing: Add pfkey/shunt-policies-nat-rw scenario

5 years agokernel-pfkey: Use address in TS to determine interface for shunt routes
Tobias Brunner [Thu, 26 Jun 2014 14:38:28 +0000 (16:38 +0200)]
kernel-pfkey: Use address in TS to determine interface for shunt routes

5 years agokernel-pfkey: Use subnet and prefix when determining nexthop for shunt policy routes
Tobias Brunner [Thu, 26 Jun 2014 13:44:54 +0000 (15:44 +0200)]
kernel-pfkey: Use subnet and prefix when determining nexthop for shunt policy routes

This is basically the same as 88f125f5605e54b38cf8913df79e32ec6bddff10.

5 years agokernel-pfkey: Install routes for shunt policies
Tobias Brunner [Thu, 26 Jun 2014 13:44:32 +0000 (15:44 +0200)]
kernel-pfkey: Install routes for shunt policies

5 years agotesting: Remove obsolete shunt-policies scenarios
Tobias Brunner [Thu, 26 Jun 2014 13:22:20 +0000 (15:22 +0200)]
testing: Remove obsolete shunt-policies scenarios

5 years agostarter: Ingore %default conn and ca sections
Tobias Brunner [Thu, 26 Jun 2014 10:23:05 +0000 (12:23 +0200)]
starter: Ingore %default conn and ca sections

5 years agoUpdated build-database.sh to 3.13.0-30-generic Ubuntu kernel
Andreas Steffen [Thu, 26 Jun 2014 09:09:25 +0000 (11:09 +0200)]
Updated build-database.sh to 3.13.0-30-generic Ubuntu kernel

5 years agoUpdated description of TNC scenarios concerning RFC 7171 PT-EAP support
Andreas Steffen [Thu, 26 Jun 2014 07:47:03 +0000 (09:47 +0200)]
Updated description of TNC scenarios concerning RFC 7171 PT-EAP support

5 years agoRemoved django.db from swid scenarios
Andreas Steffen [Thu, 26 Jun 2014 07:45:54 +0000 (09:45 +0200)]
Removed django.db from swid scenarios

5 years agoupdown: Force subnet address to be numeric
Tobias Brunner [Mon, 16 Jun 2014 13:34:05 +0000 (15:34 +0200)]
updown: Force subnet address to be numeric

5 years agowindows: Include <sys/stat.h> explicitly before overloading memset()/memcpy()
Martin Willi [Wed, 25 Jun 2014 14:06:59 +0000 (16:06 +0200)]
windows: Include <sys/stat.h> explicitly before overloading memset()/memcpy()

fstat() in newer MinGWs is defined as non-static inline. With our new static
inline memset()/memcpy() overloads, this raises a warning. To avoid it,
explicitly include <sys/stat.h> once before defining these overloads.

5 years agoeap-radius: Increase buffer for accounting attributes to maximum attribute size
Martin Willi [Wed, 25 Jun 2014 11:09:20 +0000 (13:09 +0200)]
eap-radius: Increase buffer for accounting attributes to maximum attribute size

Fixes #624.

5 years agokernel-netlink: Cast IPv6 address blobs to the proper type
Tobias Brunner [Tue, 24 Jun 2014 13:43:49 +0000 (15:43 +0200)]
kernel-netlink: Cast IPv6 address blobs to the proper type

On Android these macros are defined as functions.

5 years agoandroid: Define HAVE_DLADDR as plugin loader checks for it
Tobias Brunner [Thu, 5 Jun 2014 08:17:09 +0000 (10:17 +0200)]
android: Define HAVE_DLADDR as plugin loader checks for it

5 years agoandroid: Update Android.mk files to match changes due to the Windows port
Tobias Brunner [Tue, 24 Jun 2014 13:33:17 +0000 (15:33 +0200)]
android: Update Android.mk files to match changes due to the Windows port

Makes them easier to compare to the original Makefile.am.

5 years agocharon: Set CLOEXEC flag on daemon PID file and /dev/(u)random source FDs
Martin Willi [Tue, 24 Jun 2014 12:43:38 +0000 (14:43 +0200)]
charon: Set CLOEXEC flag on daemon PID file and /dev/(u)random source FDs

On Fedora, SELinux complains about these open file descriptors when the
updown script invokes iptables. While it seems difficult to set the flag
on all file descriptors, this at least fixes those covered by the SELinux
policy.

As these two cases are in code executed while the daemon is still single
threaded, we avoid the use of atomic but not fully portable fdopen("e") or
open(O_CLOEXEC) calls.

Fixes #519.

5 years agoutils: Add wrappers for memcpy(3), memmove(3) and memset(3)
Tobias Brunner [Tue, 24 Jun 2014 12:52:42 +0000 (14:52 +0200)]
utils: Add wrappers for memcpy(3), memmove(3) and memset(3)

These wrappers guarantee that calls to these functions are noops if the
number of bytes is 0, as calling them with NULL pointers is undefined
according to the C standard, even if the number of bytes is 0 (most
implementations probably ignore the pointers anyway in this case, but
lets make sure).

5 years agopki: Also check for MAX_COMMANDS when building getopt_long arguments
Tobias Brunner [Fri, 20 Jun 2014 15:55:48 +0000 (17:55 +0200)]
pki: Also check for MAX_COMMANDS when building getopt_long arguments

Completes 87e53819a6 and 0a8c399a21.

5 years agoAuxiliary swid_tagstats table boosts performance
Andreas Steffen [Mon, 23 Jun 2014 11:32:50 +0000 (13:32 +0200)]
Auxiliary swid_tagstats table boosts performance

5 years agoMerge branch 'algorithm-order'
Tobias Brunner [Fri, 20 Jun 2014 14:22:15 +0000 (16:22 +0200)]
Merge branch 'algorithm-order'

Restores the behavior we had before 2e22333fb (except for RNGs), that is,
algorithms are stored in the registration order again.  Which is not optimal
as we must rely on plugins to register them in a sensible order, but ordering
them by identifier definitely caused weaker algorithms to be proposed first
in the default proposal, which was even worse.

5 years agounit-tests: Add tests for DH factory
Tobias Brunner [Wed, 18 Jun 2014 15:25:47 +0000 (17:25 +0200)]
unit-tests: Add tests for DH factory

5 years agocrypto-factory: Only sort RNGs by algorithm identifier
Tobias Brunner [Fri, 20 Jun 2014 07:07:05 +0000 (09:07 +0200)]
crypto-factory: Only sort RNGs by algorithm identifier

Others remain in the order in which they were added, grouped by
algorithm identifier and sorted by benchmarking speed, if provided.

5 years agounit-tests: Add test for crypto_factory_t's rng_create method
Tobias Brunner [Tue, 6 May 2014 17:56:17 +0000 (19:56 +0200)]
unit-tests: Add test for crypto_factory_t's rng_create method

5 years agokernel-netlink: Install virtual IPv6 addresses as deprecated
Tobias Brunner [Fri, 20 Jun 2014 06:51:07 +0000 (08:51 +0200)]
kernel-netlink: Install virtual IPv6 addresses as deprecated

This should prevent the kernel's IPv6 source address selection algorithm
from using this address unless it is forced to by our source route.
This is helpful if split tunneling is used.

Fixes #598.

5 years agovici: Install libvici in ipseclibdir like we do with other libraries
Tobias Brunner [Thu, 19 Jun 2014 12:41:37 +0000 (14:41 +0200)]
vici: Install libvici in ipseclibdir like we do with other libraries

5 years agoMerge branch 'shunt-policies-routes'
Tobias Brunner [Thu, 19 Jun 2014 12:33:50 +0000 (14:33 +0200)]
Merge branch 'shunt-policies-routes'

Fixes #599.

5 years agokernel-netlink: Pass prefix when looking up next hop for shunt policies
Tobias Brunner [Wed, 18 Jun 2014 08:10:25 +0000 (10:10 +0200)]
kernel-netlink: Pass prefix when looking up next hop for shunt policies

5 years agokernel-netlink: Add support for destination prefix when determining next hop
Tobias Brunner [Wed, 18 Jun 2014 07:58:01 +0000 (09:58 +0200)]
kernel-netlink: Add support for destination prefix when determining next hop

5 years agokernel-interface: Add destination prefix to get_nexthop()
Tobias Brunner [Wed, 18 Jun 2014 07:55:39 +0000 (09:55 +0200)]
kernel-interface: Add destination prefix to get_nexthop()

This allows to determine the next hop to reach a subnet, for instance, when
installing routes for shunt policies.

5 years agoMerge branch 'passthrough-policies-priority'
Tobias Brunner [Thu, 19 Jun 2014 12:24:48 +0000 (14:24 +0200)]
Merge branch 'passthrough-policies-priority'

Introduces a new priority class for policies, which allows us to install
passthrough policies with a strictly higher priority than IPsec
policies, which was not the case previously depending on the traffic
selectors.

5 years agotesting: Add ikev2/shunt-policies-nat-rw scenario
Tobias Brunner [Thu, 19 Jun 2014 11:37:05 +0000 (13:37 +0200)]
testing: Add ikev2/shunt-policies-nat-rw scenario

5 years agotesting: Remove ikev2/shunt-policies scenario
Tobias Brunner [Thu, 19 Jun 2014 11:38:49 +0000 (13:38 +0200)]
testing: Remove ikev2/shunt-policies scenario

This scenario doesn't really apply anymore (especially its use of drop
policies).

5 years agoshunt-manager: Install passthrough policies with highest priority
Tobias Brunner [Tue, 13 May 2014 10:20:27 +0000 (12:20 +0200)]
shunt-manager: Install passthrough policies with highest priority

This avoids conflicts with regular IPsec policies.

Similarly, use the lowest priority for drop policies.

5 years agolibipsec: Add support for new policy priority class
Tobias Brunner [Tue, 13 May 2014 10:20:02 +0000 (12:20 +0200)]
libipsec: Add support for new policy priority class

5 years agokernel-pfkey: Add support for new policy priority class
Tobias Brunner [Tue, 13 May 2014 10:19:41 +0000 (12:19 +0200)]
kernel-pfkey: Add support for new policy priority class

5 years agokernel-netlink: Add support for new policy priority class
Tobias Brunner [Tue, 13 May 2014 10:17:09 +0000 (12:17 +0200)]
kernel-netlink: Add support for new policy priority class

5 years agoipsec: Add a fourth priority class for bypass policies
Tobias Brunner [Tue, 13 May 2014 10:16:33 +0000 (12:16 +0200)]
ipsec: Add a fourth priority class for bypass policies

5 years agoRemove kernel-klips plugin
Tobias Brunner [Tue, 13 May 2014 09:18:40 +0000 (11:18 +0200)]
Remove kernel-klips plugin

5 years agokernel-netlink: Follow RFC 6724 when selecting IPv6 source addresses
Tobias Brunner [Fri, 14 Mar 2014 14:41:52 +0000 (15:41 +0100)]
kernel-netlink: Follow RFC 6724 when selecting IPv6 source addresses

Instead of using the first address we find on an interface we should
consider properties like an address' scope or whether it is temporary
or public.

Fixes #543.

5 years agoMerge branch 'ipsec.conf-parser'
Tobias Brunner [Thu, 19 Jun 2014 12:04:33 +0000 (14:04 +0200)]
Merge branch 'ipsec.conf-parser'

Replaces the ipsec.conf parser in starter.  The new parser is also based
on flex/bison but it simply returns key/value collections of all sections.
It already resolves also= and allows overriding options in all included
sections (not only %default), options set in included section can also
be cleared again (key=).  It provides other improvements too, like quoted
strings (with escape sequences), unlimited includes and better
whitespace/comment handling.

Fixes #423.
Fixes #560.

5 years agostarter: Don't directly refer to source files in Makefile for unit tests
Tobias Brunner [Thu, 19 Jun 2014 09:58:15 +0000 (11:58 +0200)]
starter: Don't directly refer to source files in Makefile for unit tests

Older versions of automake have trouble recursively cleaning such
constructs properly.

5 years agostarter: Explicitly allow @# at the beginning of strings
Tobias Brunner [Wed, 18 Jun 2014 13:11:32 +0000 (15:11 +0200)]
starter: Explicitly allow @# at the beginning of strings

Since we treat everything after # as comment identities of type
ID_KEY_ID couldn't be parsed otherwise, unless quoted.

5 years agostarter: Add --conftest option to test ipsec.conf syntax
Tobias Brunner [Wed, 18 Jun 2014 09:31:49 +0000 (11:31 +0200)]
starter: Add --conftest option to test ipsec.conf syntax

5 years agostarter: Remove old parser
Tobias Brunner [Wed, 21 May 2014 13:06:12 +0000 (15:06 +0200)]
starter: Remove old parser

5 years agostarter: Use new parser to read config file
Tobias Brunner [Wed, 21 May 2014 12:51:44 +0000 (14:51 +0200)]
starter: Use new parser to read config file

5 years agostarter: Move kw_entry_t definition
Tobias Brunner [Wed, 21 May 2014 12:36:46 +0000 (14:36 +0200)]
starter: Move kw_entry_t definition

5 years agostarter: Remove unused ARG_LST argument type
Tobias Brunner [Wed, 21 May 2014 11:36:24 +0000 (13:36 +0200)]
starter: Remove unused ARG_LST argument type

5 years agostarter: Add tests for ipsec.conf parser
Tobias Brunner [Tue, 20 May 2014 16:16:48 +0000 (18:16 +0200)]
starter: Add tests for ipsec.conf parser

5 years agounit-tests: Make fixture functions optional
Tobias Brunner [Tue, 20 May 2014 17:27:50 +0000 (19:27 +0200)]
unit-tests: Make fixture functions optional

5 years agostarter: Add new bison/flex based parser for ipsec.conf
Tobias Brunner [Tue, 20 May 2014 16:15:13 +0000 (18:15 +0200)]
starter: Add new bison/flex based parser for ipsec.conf

The parser simply returns key/value pairs of all sections, it already
resolves also= and allows overriding options in all included sections
(not only %default), options set in included section can also be cleared
again (key=).
It provides other improvements too, like quoted strings (with escape
sequences), unlimited includes and better whitespace/comment handling.

5 years agostarter: Remove out of date README
Tobias Brunner [Tue, 20 May 2014 14:40:39 +0000 (16:40 +0200)]
starter: Remove out of date README

5 years agocollections: Add interface for read-only dictionaries
Tobias Brunner [Fri, 16 May 2014 09:53:08 +0000 (11:53 +0200)]
collections: Add interface for read-only dictionaries

5 years agohashtable: Add destroy_function method
Tobias Brunner [Tue, 27 Aug 2013 14:37:41 +0000 (16:37 +0200)]
hashtable: Add destroy_function method

5 years agostroke: Add --daemon option
Tobias Brunner [Thu, 20 Feb 2014 16:27:54 +0000 (17:27 +0100)]
stroke: Add --daemon option

5 years agostarter: Use stream abstraction to communicate with stroke plugin
Tobias Brunner [Thu, 20 Feb 2014 15:17:11 +0000 (16:17 +0100)]
starter: Use stream abstraction to communicate with stroke plugin

5 years agostroke: Use stream abstraction to communicate with stroke plugin
Tobias Brunner [Thu, 20 Feb 2014 15:04:36 +0000 (16:04 +0100)]
stroke: Use stream abstraction to communicate with stroke plugin

Without this changing charon.plugins.stroke.socket would not really
work.

5 years agowinhttp: Fix a typo to properly release connection handle
Martin Willi [Thu, 19 Jun 2014 09:09:20 +0000 (11:09 +0200)]
winhttp: Fix a typo to properly release connection handle

Fixes a rather large memory leak in HTTP fetches.

5 years agoload-tester: Add a crl option to include a CRL uri in generated certificates
Martin Willi [Thu, 19 Jun 2014 08:48:27 +0000 (10:48 +0200)]
load-tester: Add a crl option to include a CRL uri in generated certificates

5 years agobus: Properly va_copy() argument list before passing it to printf() functions
Martin Willi [Thu, 19 Jun 2014 08:10:54 +0000 (10:10 +0200)]
bus: Properly va_copy() argument list before passing it to printf() functions

As we later potentially use args again, we can't consume it with printf
functions without copying it first. Clone list before passing it to any
consuming function.

Fixes #621.

5 years agochild-sa: Set replay window on both inbound and outbound SA
Martin Willi [Wed, 18 Jun 2014 14:50:18 +0000 (16:50 +0200)]
child-sa: Set replay window on both inbound and outbound SA

While the outbound SA actually does not need a replay window, the kernel rejects
zero replay windows on SAs using ESN. The ESN flag is required to use the full
sequence number in ICV calculation, hence we set the replay window.

This restores the behavior we had before 30c009c2.

5 years agokernel-netlink: Never use XFRMA_REPLAY_ESN_VAL to configure zero replay windows
Martin Willi [Wed, 18 Jun 2014 12:57:21 +0000 (14:57 +0200)]
kernel-netlink: Never use XFRMA_REPLAY_ESN_VAL to configure zero replay windows

Trying to disable replay windows using the ESN attribute fails with EINVAL.
Use non-ESN legacy format to disable replay windows, even if ESN has been
negotiated over IKE.

5 years agoAdded swanctl/net2net-route scenario
Andreas Steffen [Wed, 18 Jun 2014 12:57:33 +0000 (14:57 +0200)]
Added swanctl/net2net-route scenario

5 years agoAdded swanctl/net2net-start scenario
Andreas Steffen [Wed, 18 Jun 2014 12:35:59 +0000 (14:35 +0200)]
Added swanctl/net2net-start scenario

5 years agoMinor changes in swanctl scenarios
Andreas Steffen [Wed, 18 Jun 2014 12:35:36 +0000 (14:35 +0200)]
Minor changes in swanctl scenarios

5 years agoThe policy_started check is not needed any more
Andreas Steffen [Wed, 18 Jun 2014 12:01:02 +0000 (14:01 +0200)]
The policy_started check is not needed any more

5 years agoAdded swanctl --list-pols and swanctl --stats do scenario log
Andreas Steffen [Wed, 18 Jun 2014 11:16:18 +0000 (13:16 +0200)]
Added swanctl --list-pols and swanctl --stats do scenario log

5 years agotesting: Delete accidentally committed test cases
Tobias Brunner [Wed, 18 Jun 2014 07:36:08 +0000 (09:36 +0200)]
testing: Delete accidentally committed test cases

5 years agoikev1: Allow late connection switching based on XAuth username
Tobias Brunner [Fri, 16 May 2014 08:39:22 +0000 (10:39 +0200)]
ikev1: Allow late connection switching based on XAuth username

5 years agoidentification: Only use either , or / to separate RDNs
Tobias Brunner [Mon, 5 May 2014 11:55:15 +0000 (13:55 +0200)]
identification: Only use either , or / to separate RDNs

If a DN starts with a slash (or whitespace and a slash) slashes will
be used, otherwise commas.

5 years agosshkey: Fix loading of ECDSA keys from files
Tobias Brunner [Thu, 3 Apr 2014 07:23:55 +0000 (09:23 +0200)]
sshkey: Fix loading of ECDSA keys from files

5 years agosshkey: Add support to parse SSH public keys from files with left|rightsigkey
Tobias Brunner [Thu, 3 Apr 2014 07:21:43 +0000 (09:21 +0200)]
sshkey: Add support to parse SSH public keys from files with left|rightsigkey

5 years agoMerge branch 'vici-stats'
Martin Willi [Tue, 17 Jun 2014 15:56:05 +0000 (17:56 +0200)]
Merge branch 'vici-stats'

Add a vici/swanctl "stats" command to print daemon info, similar to the header
shown in "ipsec statusall".

5 years agovici: Support memory stats without leak-detective on Windows
Martin Willi [Wed, 11 Jun 2014 14:50:59 +0000 (16:50 +0200)]
vici: Support memory stats without leak-detective on Windows

5 years agoswanctl: Add a --stats command to print daemon infos and statistics
Martin Willi [Wed, 11 Jun 2014 14:19:38 +0000 (16:19 +0200)]
swanctl: Add a --stats command to print daemon infos and statistics

5 years agovici: Add a stats command returning various daemon infos and statistics
Martin Willi [Wed, 11 Jun 2014 14:07:40 +0000 (16:07 +0200)]
vici: Add a stats command returning various daemon infos and statistics

5 years agoswanctl: Support private key decryption passhprases in swanctl.conf
Martin Willi [Wed, 4 Jun 2014 08:37:59 +0000 (10:37 +0200)]
swanctl: Support private key decryption passhprases in swanctl.conf

While there is no real security benefit of storing private keys encrypted if
the passphrase is stored along with it, there still seems to be demand for this
functionality. We add it for compatibility with ipsec.secrets, even if it is
not really recommended.

5 years agoMerge branch 'conn-specific-replay'
Martin Willi [Tue, 17 Jun 2014 14:50:14 +0000 (16:50 +0200)]
Merge branch 'conn-specific-replay'

Introduces a connection specific replay_window option, overriding the global
charon.replay_window strongswan.conf option. Original patch courtesy of
Zheng Zhong and Christophe Gouault from 6Wind.

5 years agoNEWS: Mention replay_window ipsec.conf option
Martin Willi [Tue, 17 Jun 2014 14:44:58 +0000 (16:44 +0200)]
NEWS: Mention replay_window ipsec.conf option

5 years agoswanctl: Document replay_window option
Martin Willi [Tue, 17 Jun 2014 14:48:25 +0000 (16:48 +0200)]
swanctl: Document replay_window option

5 years agovici: Support a replay_window CHILD_SA option
Martin Willi [Mon, 16 Jun 2014 15:41:07 +0000 (17:41 +0200)]
vici: Support a replay_window CHILD_SA option

5 years agostarter: Add a replay_window connection option
Martin Willi [Mon, 16 Jun 2014 15:36:13 +0000 (17:36 +0200)]
starter: Add a replay_window connection option

5 years agokernel-pfkey: Support connection specific replay window sizes up to 32 packets
Martin Willi [Mon, 16 Jun 2014 15:33:45 +0000 (17:33 +0200)]
kernel-pfkey: Support connection specific replay window sizes up to 32 packets

5 years agokernel-netlink: Support connection specific replay window sizes
Martin Willi [Mon, 16 Jun 2014 15:32:49 +0000 (17:32 +0200)]
kernel-netlink: Support connection specific replay window sizes

5 years agokernel-interface: Add a replay_window parameter to add_sa()
Martin Willi [Mon, 16 Jun 2014 15:31:43 +0000 (17:31 +0200)]
kernel-interface: Add a replay_window parameter to add_sa()

5 years agochild-cfg: Store connection specific replay window on CHILD_SA config
Martin Willi [Mon, 16 Jun 2014 15:26:33 +0000 (17:26 +0200)]
child-cfg: Store connection specific replay window on CHILD_SA config

5 years agoMerge branch 'win-errno'
Martin Willi [Tue, 17 Jun 2014 13:24:06 +0000 (15:24 +0200)]
Merge branch 'win-errno'

Improves errno handling for Winsock2 compatibility functions.

5 years agowindows: Declare strerror_s()
Martin Willi [Wed, 11 Jun 2014 15:10:19 +0000 (17:10 +0200)]
windows: Declare strerror_s()

Older MinGW versions seem to miss this function declaration. Fixes build on
Travis using Ubuntu 12.04.

5 years agowindows: Extend strerror_r/s by extended POSIX errno strings
Martin Willi [Wed, 11 Jun 2014 10:07:34 +0000 (12:07 +0200)]
windows: Extend strerror_r/s by extended POSIX errno strings

5 years agowindows: Implement strerror_r using strerror_s
Martin Willi [Wed, 11 Jun 2014 09:38:52 +0000 (11:38 +0200)]
windows: Implement strerror_r using strerror_s

5 years agowindows: Wrap most Winsock2 Posix functions to set errno
Martin Willi [Wed, 11 Jun 2014 09:08:03 +0000 (11:08 +0200)]
windows: Wrap most Winsock2 Posix functions to set errno

While Winsock provides many Posix compatibility functions, they do not set
errno, but use WSAGetLastError() for error reporting. The wrapped functions
derive an errno from WSAGetLastError() on failure.

5 years agowatcher: Prevent race condition spawning multiple watcher threads
Martin Willi [Wed, 11 Jun 2014 13:04:15 +0000 (15:04 +0200)]
watcher: Prevent race condition spawning multiple watcher threads

If file descriptors get added and removed in rapid succession, the active
watcher thread might not take notice of it and continues running. However, add()
spawns a watcher thread whenever a file descriptor is added to an empty set.
This could result in multiple watcher threads, which is fixed by a proper
check for running watchers.

5 years agothread-value: Defer cleanup handling to thread termination on Windows
Martin Willi [Wed, 11 Jun 2014 12:24:22 +0000 (14:24 +0200)]
thread-value: Defer cleanup handling to thread termination on Windows

Instead of cleaning up all thread-values during destruction, cleanup handler
is invoked when a thread detaches. Thread detaching is cough using the Windows
DllMain() entry point, and allows us to basically revert 204098a7.

Using this mechanism, we make sure that the cleanup handler is invoked by the
the correct thread. Further, this mechanism works for externally-spawned
threads which run outside of our thread_cb() routine, and works more efficiently
with short-running threads.

5 years agosocket-win: Use non-overlapped I/O and socket event selection
Martin Willi [Tue, 10 Jun 2014 13:58:31 +0000 (15:58 +0200)]
socket-win: Use non-overlapped I/O and socket event selection

The use of overlapped I/O was incorrect, as we passed stack based buffers, but
did not cancel/wait for pending completion on all sockets. Our receive-from-all
socket interface is actually tricky to implement using overlapped I/O. Switch
to WSAEventSelect() event management, which can be canceled properly while
working in a select()-like way.