Martin Willi [Tue, 4 Feb 2014 10:14:27 +0000 (11:14 +0100)]
charon-cmd: Block SIGUSR1 on worker threads
To properly shut down charon-cmd with leak reports, only the main thread
should catch SIGUSR1 to shut down the application. Work threads should ignore
SIGUSR1 to avoid any hard application termination.
Martin Willi [Thu, 7 Nov 2013 08:21:02 +0000 (09:21 +0100)]
ike: Restart inactivity counter after doing a CHILD_SA rekey
When doing a rekey for a CHILD_SA, the use counters get reset. An inactivity
job is queued for a time unrelated to the rekey time, so it might happen
that the inactivity job gets executed just after rekeying. If this happens,
inactivity is detected even if we had traffic on the rekeyed CHILD_SA just
before rekeying.
This change implies that inactivity checks can't handle inactivity timeouts
for rekeyed CHILD_SAs, and therefore requires that inactivity timeout is shorter
than the rekey time to have any effect.
Tobias Brunner [Fri, 15 Nov 2013 13:54:42 +0000 (14:54 +0100)]
unity: Send UNITY_SPLIT_INCLUDE attributes with proper padding
The additional 6 bytes are not actually padding but are parsed by the
Cisco client as protocol and src and dst ports (each two bytes but
strangely only the first two in network order).
Tobias Brunner [Thu, 23 Jan 2014 09:27:49 +0000 (10:27 +0100)]
Merge branch 'ipcomp'
Fixes compatibility issues between firewall rules (leftfirewall=yes)
and IPComp (compress=yes), plus issues with IPComp when used with
multiple subnets in left|rightsubnet.
Tobias Brunner [Thu, 7 Nov 2013 19:58:42 +0000 (20:58 +0100)]
kernel-netlink: Selectively add selector on SAs that use IPComp
Don't add a selector to tunnel mode SAs, these might serve multiple
traffic selectors but with only one selector on the SA only the traffic
matching the first one would actually get tunneled.
Tobias Brunner [Thu, 7 Nov 2013 16:50:02 +0000 (17:50 +0100)]
updown: Allow IPIP traffic if IPComp was negotiated
The kernel implicitly creates an IPIP SA if an IPComp SA is installed.
This SA is used inbound for small packets that are not compressed.
Since the addresses are different (they are the tunnel addresses not
those of the tunneled traffic) additional rules are required if the
traffic selector does not cover the tunnel addresses (e.g. due to a NAT).
For SAs with multiple traffic selectors duplicate rules will get installed.
Tobias Brunner [Mon, 25 Nov 2013 17:20:13 +0000 (18:20 +0100)]
configure: Add -Wno-format-security to default CFLAGS
Either due to a change in Ubuntu 13.10 or GCC 4.8 -Wno-format has no
effect if -Wformat-security is enabled (which it is on Ubuntu) so we
also disable the latter by default.
Martin Willi [Tue, 21 Jan 2014 16:36:38 +0000 (17:36 +0100)]
stream: Make sure no watcher callback is active while changing stream callbacks
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.
Thomas Egerer [Mon, 18 Nov 2013 12:15:02 +0000 (13:15 +0100)]
dhcp: Allow binding of socket to particular interface
In certain situations it is desirable to bind the send/receive sockets
for the DHCP address allocation to a particular interface. With this
patch the strongswan.conf option charon.plugins.dhcp.interface can be
used to restrict the DHCP communication to a configurable interface.
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
Thomas Egerer [Fri, 29 Nov 2013 12:17:30 +0000 (13:17 +0100)]
proposal: Add possibility to register custom proposal keyword parser
If a proposal string cannot be matched to a token using strcmp (e.g. if
you want to register a whole class of algorithms containing their ID,
like my_alg_2342), you can use the provided function to register a
parser that transforms the given string into a proposal token.
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
Thomas Egerer [Thu, 16 Jan 2014 12:24:08 +0000 (13:24 +0100)]
ike_sa: Defer task manager destruction after child destruction
This patch exports the task manager's flush to allow flushing of all
queues with one function call from ike_sa->destroy. It allows the
access of intact children during task destructoin (see git-commit e44ebdcf) and allows the access of the task manager in
child_state_change hook.
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
Martin Willi [Wed, 15 Jan 2014 17:18:24 +0000 (18:18 +0100)]
printf-hook-builtin: Correctly calculate written bytes in print_in_hook()
The hook data counts remaining buffer bytes, not used ones. Counting them
correctly fixes a crash for long hexdumps.
Further, print_in_hook() must return the number of bytes that would have been
written, not the actually written bytes. This is important, as we allocate a
dynamic buffer in bus that relies on the exact byte count. Fixes long hexdumps
that got truncated.