Commit Graph

43 Commits

Author SHA1 Message Date
Andreas Steffen b12c53ce77 Use standard unsigned integer types 2016-03-24 18:52:48 +01:00
Shota Fukumori b210369314 updown: Get value for PLUTO_MARK_{IN,OUT} from CHILD_SA
Or the invoked script will get a broken value when `mark=%unique` is
used in a configuration.

Closes strongswan/strongswan#37.
2016-03-23 14:45:04 +01:00
Andreas Steffen 3f1de98678 Support of IP address ranges in traffic selectors 2016-03-10 13:59:37 +01:00
Andreas Steffen ad82c95f0a Set PLUTO port variables to 0 in the case of no port restrictions 2016-03-04 12:52:35 +01:00
Andreas Steffen 0d7202c7c5 Port range support in updown script 2016-03-04 09:52:34 +01:00
Tobias Brunner 28649f6d91 libhydra: Remove empty unused library 2016-03-03 17:36:11 +01:00
Tobias Brunner 8394ea2a42 libhydra: Move kernel interface to libcharon
This moves hydra->kernel_interface to charon->kernel.
2016-03-03 17:36:11 +01:00
Tobias Brunner 1de31bcc2b updown: Pass virtual IPs assigned to a peer to the updown script
Previously only received virtual IPs were available.

References #1008.
2015-08-06 16:30:08 +02:00
Martin Willi b9be25ea39 attribute-handler: Pass full IKE_SA to handler backends 2015-02-20 13:34:56 +01:00
Martin Willi 751363275f attributes: Move the configuration attributes framework to libcharon 2015-02-20 13:34:55 +01:00
Martin Willi 4736ba0657 updown: Explicitly pass caller PATH to updown script
When invoking /bin/sh, its default PATH is used. On some systems, that does
not include the PATH where the ipsec script is installed, as charon is invoked
with a custom PATH. Explicitly setting the PATH of charon should fix this
case, properly invoking the (default) updown script.

Fixes #745.
2014-10-22 14:53:36 +02:00
Martin Willi 6890bdc7a0 updown: Use process abstraction to invoke updown script 2014-10-06 18:24:39 +02:00
Tobias Brunner 4431e1e04d updown: Force subnet address to be numeric 2014-06-25 16:17:15 +02:00
Martin Willi 4163421f91 plugins: Don't link with -rdynamic on Windows 2014-06-04 15:53:02 +02:00
Tobias Brunner d223fe807a libcharon: Use lib->ns instead of charon->name 2014-02-12 14:34:32 +01:00
Martin Willi ac2dc3b726 updown: Return an empty DNS server enumerator if no IKE_SA available
The one existing caller does not handle a NULL return and always expects
an enumerator; and returning FALSE does not make sense anyway.
2014-02-06 16:38:39 +01:00
Tobias Brunner 7e3bbcf77a updown: Increase buffer size for script and environment variables 2014-01-23 10:27:12 +01:00
Tobias Brunner cf4a7395aa updown: Add PLUTO_IPCOMP to indicate if IPComp was negotiated 2014-01-23 10:27:12 +01:00
Ansis Atteka 4334735605 updown: fix segfault when interface name can't be resolved
The child_updown() function sets up environment variables to the updown
script. Sometimes call to hydra->kernel_interface->get_interface() could
fail and iface variable could be left uninitialized. This patch fixes
this issue by passing "unknown" as interface name.

Here is the stacktrace:

0  0x00007fa90791f445 in raise () from /lib/x86_64-linux-gnu/libc.so.6
1  0x00007fa907922bab in abort () from /lib/x86_64-linux-gnu/libc.so.6
2  0x0000000000401ed7 in segv_handler (signal=11) at charon.c:183
3  <signal handler called>
4  0x00007fa90793221f in vfprintf () from /lib/x86_64-linux-gnu/libc.so.6
5  0x00007fa9079f0580 in __vsnprintf_chk () from /lib/x86_64-linux-gnu/libc.so.6
6  0x00007fa9079f04c8 in __snprintf_chk () from /lib/x86_64-linux-gnu/libc.so.6
7  0x00007fa8f9b95b86 in snprintf (
    __fmt=0x7fa8f9b961b8 "2>&1 PLUTO_VERSION='1.1' PLUTO_VERB='%s%s%s' PLUTO_CONNECTION='%s' PLUTO_INTERFACE='%s' PLUTO_REQID='%u' PLUTO_ME='%H' PLUTO_MY_ID='%Y' PLUTO_MY_CLIENT='%H/%u' PLUTO_MY_PORT='%u' PLUTO_MY_PROTOCOL='%u"..., __n=1024, __s=0x7fa8f7923440 "2>&1 PLUTO_VERSION='1.1' PLUTO_VERB='up-host' PLUTO_CONNECTION='remote-40.0.0.40' PLUTO_INTERFACE='\367\250\177")
    at /usr/include/x86_64-linux-gnu/bits/stdio2.h:65
8  child_updown (this=0x8486b0, ike_sa=0x7fa8e4005f80, child_sa=0x7fa8d4008290, up=true) at updown_listener.c:308
9  0x00007fa907ecc11c in ?? () from /usr/lib/strongswan/libcharon.so.0
10 0x00007fa907ef89bf in ?? () from /usr/lib/strongswan/libcharon.so.0
11 0x00007fa907ef2fc8 in ?? () from /usr/lib/strongswan/libcharon.so.0
12 0x00007fa907ee84ff in ?? () from /usr/lib/strongswan/libcharon.so.0
13 0x00007fa907ee3067 in ?? () from /usr/lib/strongswan/libcharon.so.0
14 0x00007fa90835e8fb in ?? () from /usr/lib/strongswan/libstrongswan.so.0
15 0x00007fa908360d30 in ?? () from /usr/lib/strongswan/libstrongswan.so.0
16 0x00007fa907cade9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
17 0x00007fa9079db4bd in clone () from /lib/x86_64-linux-gnu/libc.so.6
18 0x0000000000000000 in ?? ()

Signed-Off-By: Ansis Atteka <aatteka@nicira.com>
2013-10-30 09:29:41 +01:00
Tobias Brunner 9739a0bf67 updown: Pass ICMP[v6] message type and code to updown script
The type is passed in $PLUTO_MY_PORT and the code in $PLUTO_PEER_PORT.
2013-10-17 16:57:39 +02:00
Martin Willi c5d9b133e0 updown: Add a PLUTO_PROTO variable set to 'ah' or 'esp' 2013-10-11 10:15:21 +02:00
Martin Willi 881e9a7e2e updown: remove description of unsupported PLUTO_ variables
These have been set by pluto, but are not by charons updown plugin.
2013-08-08 14:48:32 +02:00
Martin Willi 19cb07b890 automake: replace INCLUDES by AM_CPPFLAGS
INCLUDES are now deprecated and throw warnings when using automake 1.13.
We now also differentiate AM_CPPFLAGS and AM_CFLAGS, where includes and
defines are passed to AM_CPPFLAGS only.
2013-07-18 14:59:19 +02:00
Tobias Brunner 49d333ac67 updown: Use plugin features to register listener and attribute handler 2013-06-11 11:18:19 +02:00
Emanuil Hristov 2ce403438f updown: pass IKE_SA unique ID in PLUTO_UNIQUEID 2013-05-16 10:13:22 +02:00
Martin Willi 5b89e3b061 Pass PLUTO_XAUTH_ID to updown script 2012-11-16 09:56:05 +01:00
Tobias Brunner 12642a6831 Moved data structures to new collections subfolder 2012-10-24 16:00:49 +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
Martin Willi 101d26babe Support multiple virtual IPs on peer_cfg and ike_sa classes 2012-08-30 16:43:42 +02:00
Martin Willi e0d3014a17 Add a DNS attribute handler to updown, passing servers to updown script 2012-08-21 09:38:01 +02:00
Andreas Steffen 145a8b04d1 correctly destroy the hosts 2011-06-03 00:43:47 +02:00
Andreas Steffen a8d0bd7465 fixed subnet to string conversion by using ts_to_subnet() 2011-06-03 00:26:39 +02:00
Martin Willi c55818ebb0 Added a (not yet implemented) plugin_t method to reload plugin configuration 2011-04-15 10:07:13 +02:00
Martin Willi 787b5884aa Added a get_name() function to plugin_t, create_plugin_enumerator enumerates over plugin_t 2011-04-15 10:07:12 +02:00
Martin Willi 6e2791715b Migrated remaining plugin_t implementations to INIT/METHOD macros 2011-04-15 10:07:12 +02:00
Tobias Brunner f6659688ab Refer to kernel interface via hydra and not charon. 2010-09-02 19:01:25 +02:00
Andreas Steffen ae0e3b03b7 in a ESP_IN_UDP situation make UDP port available in the updown script 2010-07-17 13:27:19 +02:00
Andreas Steffen 14665981a5 make xfrm marks available in the updown scripts 2010-07-17 13:08:50 +02:00
Tobias Brunner 6f52d3b077 Compiler warning fixed. 2010-06-28 08:50:30 +02:00
Martin Willi 89bf11d204 Respect line with in Makefile.am's, other cosmetics 2010-03-25 14:54:56 +01:00
Tobias Brunner 58f86d0f0f Changed all usages of lib->attributes to hydra->attributes. 2010-03-24 18:54:26 +01:00
Tobias Brunner bd3f8ea30b Convert charon into libcharon. 2010-03-19 13:34:52 +01:00
Tobias Brunner 08c5572602 Moving charon to libcharon. 2010-03-19 13:34:52 +01:00