mirror of
https://github.com/curl/curl.git
synced 2025-09-30 16:06:51 +03:00
- Phil Blundell: If you ask ares_gethostbyname() to do an AF_INET6 lookup and
the target host has only A records, it automatically falls back to an AF_INET lookup and gives you the A results. However, if the target host has a CNAME record, this behaviour is defeated since the original query does return some data even though ares_parse_aaa_reply() doesn't consider it relevant. Here's a small patch to make it behave the same with and without the CNAME.
This commit is contained in:
parent
82412f218f
commit
e3b5673e98
|
@ -1,5 +1,14 @@
|
||||||
Changelog for the c-ares project
|
Changelog for the c-ares project
|
||||||
|
|
||||||
|
* Jul 3 2008 (Daniel Stenberg)
|
||||||
|
- Phil Blundell: If you ask ares_gethostbyname() to do an AF_INET6 lookup and
|
||||||
|
the target host has only A records, it automatically falls back to an
|
||||||
|
AF_INET lookup and gives you the A results. However, if the target host has
|
||||||
|
a CNAME record, this behaviour is defeated since the original query does
|
||||||
|
return some data even though ares_parse_aaa_reply() doesn't consider it
|
||||||
|
relevant. Here's a small patch to make it behave the same with and without
|
||||||
|
the CNAME.
|
||||||
|
|
||||||
* Jul 2 2008 (Yang Tse)
|
* Jul 2 2008 (Yang Tse)
|
||||||
- Fallback to gettimeofday when monotonic clock is unavailable at run-time.
|
- Fallback to gettimeofday when monotonic clock is unavailable at run-time.
|
||||||
|
|
||||||
|
|
|
@ -176,6 +176,15 @@ static void host_callback(void *arg, int status, int timeouts,
|
||||||
else if (hquery->family == AF_INET6)
|
else if (hquery->family == AF_INET6)
|
||||||
{
|
{
|
||||||
status = ares_parse_aaaa_reply(abuf, alen, &host, NULL, NULL);
|
status = ares_parse_aaaa_reply(abuf, alen, &host, NULL, NULL);
|
||||||
|
if (status == ARES_ENODATA)
|
||||||
|
{
|
||||||
|
/* The query returned something (e.g. CNAME) but there were no
|
||||||
|
AAAA records. Try looking up A instead. */
|
||||||
|
hquery->family = AF_INET;
|
||||||
|
ares_search(hquery->channel, hquery->name, C_IN, T_A, host_callback,
|
||||||
|
hquery);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (host && channel->nsort)
|
if (host && channel->nsort)
|
||||||
sort6_addresses(host, channel->sortlist, channel->nsort);
|
sort6_addresses(host, channel->sortlist, channel->nsort);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user