On 4/21/22 3:49 PM, Dmitry Karpov via c-ares wrote:

Hi,


I recently stepped on an issue with curl using c-ares ares_getaddrinfo() with PF_UNSPEC family, when AAAA response from DNS server contained some bad data resulting into ARES_EBADRESP status code whereas A response was good.

The problem was that when AAAA response was the last received, it made c-ares to ignore previously received good A response and fail the host resolution with ARES_EBADRESP status code. But if A response was the last received, then c-ares ignored the bad AAAA response and the host resolution was successful.

I looked at the c-ares code, and found the problem in the host_callback() function (src\lib\ares_getaddrinfo.c: 528)

...

When there are no remaining queries, the ARES_EBADRESP parsing error is reported immediately, even though the previous query might be successful.

...

I am also attaching a patch file with the potential fix.

Thanks,
Dmitry Karpov



Thanks! This patch has been applied to main.

-Brad
-- 
c-ares mailing list
c-ares@lists.haxx.se
https://lists.haxx.se/listinfo/c-ares

Reply via email to