aboutsummaryrefslogtreecommitdiffstats
path: root/src/charon
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2009-09-21 15:19:39 +0200
committerMartin Willi <martin@strongswan.org>2009-09-21 15:30:40 +0200
commitc6a8990bc5db3d737ef594580ad10f0b36bed220 (patch)
treeeb88e0f11709bd972bc2f1527d46a83d692b1682 /src/charon
parentc331bce51dcf0fc75c181d2343b62d698630b735 (diff)
downloadstrongswan-c6a8990bc5db3d737ef594580ad10f0b36bed220.tar.bz2
strongswan-c6a8990bc5db3d737ef594580ad10f0b36bed220.tar.xz
Enforce a local address of the same family as remote address
Diffstat (limited to 'src/charon')
-rw-r--r--src/charon/sa/ike_sa.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/charon/sa/ike_sa.c b/src/charon/sa/ike_sa.c
index 5a0ab5dc9..02e2fec45 100644
--- a/src/charon/sa/ike_sa.c
+++ b/src/charon/sa/ike_sa.c
@@ -1075,9 +1075,15 @@ static void resolve_hosts(private_ike_sa_t *this)
}
else
{
+ int family = 0;
+
+ /* use same address family as for other */
+ if (!this->other_host->is_anyaddr(this->other_host))
+ {
+ family = this->other_host->get_family(this->other_host);
+ }
host = host_create_from_dns(this->ike_cfg->get_my_addr(this->ike_cfg),
- this->my_host->get_family(this->my_host),
- IKEV2_UDP_PORT);
+ family, IKEV2_UDP_PORT);
if (host && host->is_anyaddr(host) &&
!this->other_host->is_anyaddr(this->other_host))