aboutsummaryrefslogtreecommitdiffstats
path: root/src/charon/sa
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2008-07-09 14:16:19 +0000
committerMartin Willi <martin@strongswan.org>2008-07-09 14:16:19 +0000
commite7991a2eef78575cad311088099e15c29e3f5170 (patch)
treee34d677b9edc004130eea0cb85540be8495ea87d /src/charon/sa
parent6c652e6b553b95b3fd97c906d6835fe858c98648 (diff)
downloadstrongswan-e7991a2eef78575cad311088099e15c29e3f5170.tar.bz2
strongswan-e7991a2eef78575cad311088099e15c29e3f5170.tar.xz
do a route lookup to allow routing of left=%any connections
Diffstat (limited to 'src/charon/sa')
-rw-r--r--src/charon/sa/ike_sa.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/charon/sa/ike_sa.c b/src/charon/sa/ike_sa.c
index 6805a7ea6..feb8d8dad 100644
--- a/src/charon/sa/ike_sa.c
+++ b/src/charon/sa/ike_sa.c
@@ -1041,18 +1041,28 @@ static void resolve_hosts(private_ike_sa_t *this)
{
host_t *host;
- host = host_create_from_dns(this->ike_cfg->get_my_addr(this->ike_cfg), 0,
- IKEV2_UDP_PORT);
+ host = host_create_from_dns(this->ike_cfg->get_other_addr(this->ike_cfg),
+ 0, IKEV2_UDP_PORT);
if (host)
{
- set_my_host(this, host);
+ set_other_host(this, host);
}
- host = host_create_from_dns(this->ike_cfg->get_other_addr(this->ike_cfg),
+
+ 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);
+
+ if (host && host->is_anyaddr(host) &&
+ !this->other_host->is_anyaddr(this->other_host))
+ {
+ host->destroy(host);
+ host = charon->kernel_interface->get_source_addr(
+ charon->kernel_interface, this->other_host);
+ host->set_port(host, IKEV2_UDP_PORT);
+ }
if (host)
{
- set_other_host(this, host);
+ set_my_host(this, host);
}
}