fallback to family specific %any(6) if kernel lookup fails
authorMartin Willi <martin@strongswan.org>
Mon, 16 Mar 2009 14:23:36 +0000 (14:23 -0000)
committerMartin Willi <martin@strongswan.org>
Mon, 16 Mar 2009 14:23:36 +0000 (14:23 -0000)
src/charon/sa/ike_sa.c
src/libstrongswan/utils/host.c

index 30141f5..17ba15e 100644 (file)
@@ -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)
index cb2b6a1..e11017c 100644 (file)
@@ -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, '.'))