aboutsummaryrefslogtreecommitdiffstats
path: root/main/strongswan/0004-ike-Use-address-family-of-local-address-when-resolvi.patch
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2015-07-28 11:33:38 +0300
committerTimo Teräs <timo.teras@iki.fi>2015-07-28 11:35:47 +0300
commitfc1ceeb02b3e149645205e67bcc009e742140590 (patch)
treeb559837b40485a7c0f77ce6459c03f131191283d /main/strongswan/0004-ike-Use-address-family-of-local-address-when-resolvi.patch
parentc3aa1460dbeb4e1e10972fc00314d7a80413707e (diff)
downloadaports-fc1ceeb02b3e149645205e67bcc009e742140590.tar.bz2
aports-fc1ceeb02b3e149645205e67bcc009e742140590.tar.xz
main/strongswan: cherry-pick upstream fixes
also fixes a minor memory leak in patch 1001 (the offending hunk is now just deleted, as other upstream commits fixed the issue it tried to address)
Diffstat (limited to 'main/strongswan/0004-ike-Use-address-family-of-local-address-when-resolvi.patch')
-rw-r--r--main/strongswan/0004-ike-Use-address-family-of-local-address-when-resolvi.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/main/strongswan/0004-ike-Use-address-family-of-local-address-when-resolvi.patch b/main/strongswan/0004-ike-Use-address-family-of-local-address-when-resolvi.patch
new file mode 100644
index 0000000000..7114d6247a
--- /dev/null
+++ b/main/strongswan/0004-ike-Use-address-family-of-local-address-when-resolvi.patch
@@ -0,0 +1,48 @@
+From a11048adee0aeab8af10259f406363d7cc6beccc Mon Sep 17 00:00:00 2001
+From: Tobias Brunner <tobias@strongswan.org>
+Date: Thu, 11 Jun 2015 15:10:29 +0200
+Subject: [PATCH] ike: Use address family of local address when resolving
+ remote host
+
+If static local addresses are configured we should use their address family
+as a hint when resolving the remote address.
+We don't do this if %any is configured as this might break existing
+configurations (%any4 and %any6 are however used as hint).
+---
+ src/libcharon/sa/ike_sa.c | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/src/libcharon/sa/ike_sa.c b/src/libcharon/sa/ike_sa.c
+index 3aafa4c..0c13c58 100644
+--- a/src/libcharon/sa/ike_sa.c
++++ b/src/libcharon/sa/ike_sa.c
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (C) 2006-2014 Tobias Brunner
++ * Copyright (C) 2006-2015 Tobias Brunner
+ * Copyright (C) 2006 Daniel Roethlisberger
+ * Copyright (C) 2005-2009 Martin Willi
+ * Copyright (C) 2005 Jan Hutter
+@@ -1200,6 +1200,19 @@ static void resolve_hosts(private_ike_sa_t *this)
+ break;
+ }
+
++ /* if an IP address is set locally, use the same family to resolve remote */
++ if (family == AF_UNSPEC && !this->remote_host)
++ {
++ if (this->local_host)
++ {
++ family = this->local_host->get_family(this->local_host);
++ }
++ else
++ {
++ family = ike_cfg_get_family(this->ike_cfg, TRUE);
++ }
++ }
++
+ if (this->remote_host)
+ {
+ host = this->remote_host->clone(this->remote_host);
+--
+2.4.6
+