ares_parse_a_reply: fix CNAME response parsing

Reply to a CNAME query doesn't contain addresses, causing
ares_parse_a_reply() to bail out with ARES_ENODATA

Bug: http://groups.google.com/group/nodejs/browse_thread/thread/a1268c9ea5e9ad9b
pull/2/head
Ben Noordhuis 14 years ago committed by Daniel Stenberg
parent 41b8a1bfd0
commit 2c63440127
  1. 4
      ares_parse_a_reply.c

@ -201,7 +201,9 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
}
}
if (status == ARES_SUCCESS && naddrs == 0)
if (status == ARES_SUCCESS && naddrs == 0 && naliases == 0)
/* the check for naliases to be zero is to make sure CNAME responses
don't get caught here */
status = ARES_ENODATA;
if (status == ARES_SUCCESS)
{

Loading…
Cancel
Save