static void resolve_hosts(private_ike_sa_t *this)
{
host_t *host;
+ int family = 0;
+
+ switch (charon->socket->supported_families(charon->socket))
+ {
+ case SOCKET_FAMILY_IPV4:
+ family = AF_INET;
+ break;
+ case SOCKET_FAMILY_IPV6:
+ family = AF_INET6;
+ break;
+ case SOCKET_FAMILY_BOTH:
+ case SOCKET_FAMILY_NONE:
+ break;
+ }
if (this->remote_host)
{
other_addr = this->ike_cfg->get_other_addr(this->ike_cfg, NULL);
other_port = this->ike_cfg->get_other_port(this->ike_cfg);
- host = host_create_from_dns(other_addr, 0, other_port);
+ host = host_create_from_dns(other_addr, family, other_port);
}
if (host)
{
{
char *my_addr;
u_int16_t my_port;
- int family = 0;
/* use same address family as for other */
if (!this->other_host->is_anyaddr(this->other_host))
}
else
{ /* fallback to address family specific %any(6), if configured */
- host = host_create_from_dns(my_addr, 0, my_port);
+ host = host_create_from_dns(my_addr, family, my_port);
}
}
}