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.
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.
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.
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.
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.
Martin Willi [Tue, 17 Jun 2014 13:15:02 +0000 (15:15 +0200)]
Merge branch 'attr-enum'
Introduces a handle_vips() hook very similar to assign_vips(), but for clients
handling virtual IPs and other configuration attributes. Non-handled attributes
are stored on the IKE_SA as well and can be enumerated.
Martin Willi [Tue, 11 Feb 2014 09:09:08 +0000 (10:09 +0100)]
bus: Add a handle_vips() hook invoked after handling configuration attributes
Similar to assign_vips() used by a peer assigning virtual IPs to the other peer,
the handle_vips() hook gets invoked on a peers after receiving attributes. On
release of the same attributes the hook gets invoked again.
This is useful to inspect handled attributes, as the ike_updown() hook is
invoked after authentication, when attributes have not been handled yet.
Martin Willi [Wed, 4 Jun 2014 14:32:23 +0000 (16:32 +0200)]
Merge branch 'win-kernel'
Adds the kernel-iph and kernel-wfp kernel backends for the Windows platform.
kernel-iph provides a networking backend using the IP Helper native Windows
API, while the kernel-wfp backend implements an interface to the Windows Kernel
IPsec layer using the Windows Filtering Platform API.
Martin Willi [Tue, 24 Dec 2013 10:27:59 +0000 (11:27 +0100)]
child-sa: Pass the number of total policies tied to an SA to the kernel
This will be useful if the kernel backend has to know how many policies
follow an SA install, for example if it must install all policies concurrently.
Martin Willi [Mon, 23 Dec 2013 17:45:13 +0000 (18:45 +0100)]
kernel-wfp: Set flag to get UDP encapsulation with tunnel mode working
Having this flag set fixes connections initiated by the Windows host, but
unfortunately does not yet fix incoming connections. Connection state issue?
We still see 0xc00000e2 error events, translating to INTERNAL_ERROR.
Martin Willi [Thu, 19 Dec 2013 15:55:43 +0000 (16:55 +0100)]
kernel-wfp: Manually create a ProviderContext to attach individual filters
This gives us more flexibility than using the intransparent FwpmIPsecTunnelAdd,
and fixes the issues we have seen with trap policies. Forward filters are
still missing, but required for site-to-site tunnels.