diff options
author | Martin Willi <martin@strongswan.org> | 2009-03-16 14:23:36 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2009-03-16 14:23:36 +0000 |
commit | 9717826f10d5a0e1c15e0501fb28e9a90dee89fd (patch) | |
tree | 5b5f91582f640db087e99386a06623a4689b4d72 | |
parent | 8065780f4a1d6a9913c3c6a948f7554ce2898401 (diff) | |
download | strongswan-9717826f10d5a0e1c15e0501fb28e9a90dee89fd.tar.bz2 strongswan-9717826f10d5a0e1c15e0501fb28e9a90dee89fd.tar.xz |
fallback to family specific %any(6) if kernel lookup fails
-rw-r--r-- | src/charon/sa/ike_sa.c | 6 | ||||
-rw-r--r-- | src/libstrongswan/utils/host.c | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/charon/sa/ike_sa.c b/src/charon/sa/ike_sa.c index 30141f551..17ba15e27 100644 --- a/src/charon/sa/ike_sa.c +++ b/src/charon/sa/ike_sa.c @@ -1102,6 +1102,12 @@ static void resolve_hosts(private_ike_sa_t *this) { host->set_port(host, IKEV2_UDP_PORT); } + else + { /* fallback to address family specific %any(6), if configured */ + host = host_create_from_dns( + this->ike_cfg->get_my_addr(this->ike_cfg), + 0, IKEV2_UDP_PORT); + } } } if (host) diff --git a/src/libstrongswan/utils/host.c b/src/libstrongswan/utils/host.c index cb2b6a10f..e11017c1e 100644 --- a/src/libstrongswan/utils/host.c +++ b/src/libstrongswan/utils/host.c @@ -374,6 +374,10 @@ host_t *host_create_from_string(char *string, u_int16_t port) { return host_create_any(AF_INET); } + if (streq(string, "%any6")) + { + return host_create_any(AF_INET6); + } this = host_create_empty(); if (strchr(string, '.')) |