Mercurial > pidgin
comparison libpurple/dnsquery.c @ 26923:cf373257effb
Don't do IPv6 AAAA lookups if there is no IPv6 address configured on
this machine.
From the getaddrinfo() man page:
"If hints.ai_flags includes the AI_ADDRCONFIG flag, then IPv4 addresses
are returned in the list pointed to by result only if the local system
has at least one IPv4 address configured, and IPv6 addresses are only
returned if the local system has at least one IPv6 address configured."
It's my understanding that this flag is non-standard (a GNUism perhaps),
which is why it's surrounded in #ifdefs.
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Wed, 20 May 2009 17:24:52 +0000 |
parents | 8290e36a5a73 |
children | c162a088489f |
comparison
equal
deleted
inserted
replaced
26922:2e849a9adc01 | 26923:cf373257effb |
---|---|
254 * passing a number already, we know this | 254 * passing a number already, we know this |
255 * value will not be really used by the C | 255 * value will not be really used by the C |
256 * library. | 256 * library. |
257 */ | 257 */ |
258 hints.ai_socktype = SOCK_STREAM; | 258 hints.ai_socktype = SOCK_STREAM; |
259 #ifdef AI_ADDRCONFIG | |
260 hints.ai_flags |= AI_ADDRCONFIG; | |
261 #endif /* AI_ADDRCONFIG */ | |
259 rc = getaddrinfo(dns_params.hostname, servname, &hints, &res); | 262 rc = getaddrinfo(dns_params.hostname, servname, &hints, &res); |
260 write_to_parent(child_out, &rc, sizeof(rc)); | 263 write_to_parent(child_out, &rc, sizeof(rc)); |
261 if (rc != 0) { | 264 if (rc != 0) { |
262 close(child_out); | 265 close(child_out); |
263 if (show_debug) | 266 if (show_debug) |
704 * passing a number already, we know this | 707 * passing a number already, we know this |
705 * value will not be really used by the C | 708 * value will not be really used by the C |
706 * library. | 709 * library. |
707 */ | 710 */ |
708 hints.ai_socktype = SOCK_STREAM; | 711 hints.ai_socktype = SOCK_STREAM; |
712 #ifdef AI_ADDRCONFIG | |
713 hints.ai_flags |= AI_ADDRCONFIG; | |
714 #endif /* AI_ADDRCONFIG */ | |
709 if ((rc = getaddrinfo(query_data->hostname, servname, &hints, &res)) == 0) { | 715 if ((rc = getaddrinfo(query_data->hostname, servname, &hints, &res)) == 0) { |
710 tmp = res; | 716 tmp = res; |
711 while(res) { | 717 while(res) { |
712 query_data->hosts = g_slist_append(query_data->hosts, | 718 query_data->hosts = g_slist_append(query_data->hosts, |
713 GSIZE_TO_POINTER(res->ai_addrlen)); | 719 GSIZE_TO_POINTER(res->ai_addrlen)); |