Commit 786c1614 authored by Ghislain MARY's avatar Ghislain MARY

Prefer NAT64 address when choosing the STUN server IP address on IPv6 only network.

parent d5f765da
......@@ -577,8 +577,12 @@ static const struct addrinfo * get_preferred_stun_server_addrinfo(const struct a
else if (ai->ai_family == AF_INET6) {
struct sockaddr_storage ss;
socklen_t sslen = sizeof(ss);
bctbx_sockaddr_ipv6_to_ipv4(ai->ai_addr, (struct sockaddr *)&ss, &sslen);
if ((ss.ss_family == AF_INET) && (preferred_ai == NULL)) preferred_ai = ai;
bctbx_sockaddr_remove_nat64_mapping(ai->ai_addr, (struct sockaddr *)&ss, &sslen);
if (ss.ss_family == AF_INET) {
preferred_ai = ai;
break;
}
preferred_ai = ai;
}
ai = ai->ai_next;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment