Commit 891d44e4 authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Fix address family of IPv4 DNS results if the result is a v4mapped address.

parent 26fc492b
......@@ -1072,6 +1072,15 @@ static void dual_resolver_context_check_finished(belle_sip_dual_resolver_context
static void on_ipv4_results(void *data, const char *name, struct addrinfo *ai_list, uint32_t ttl) {
belle_sip_dual_resolver_context_t *ctx = BELLE_SIP_DUAL_RESOLVER_CONTEXT(data);
struct addrinfo *ai = ai_list;
/* Convert v4mapped results to v4 */
while (ai != NULL) {
if (ai->ai_family == AF_INET6) {
bctbx_sockaddr_ipv6_to_ipv4(ai->ai_addr, ai->ai_addr, &ai->ai_addrlen);
if (ai->ai_addr->sa_family == AF_INET) ai->ai_family = AF_INET;
ai = ai->ai_next;
ctx->a_results = ai_list;
ctx->a_notified = TRUE;
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