<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    On 4/21/22 3:49 PM, Dmitry Karpov via c-ares wrote:<br>
    <blockquote type="cite"
cite="mid:BYAPR01MB5606813309D80AB8DDAB0219C3F49@BYAPR01MB5606.prod.exchangelabs.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style>@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}div.WordSection1
        {page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal">Hi,<o:p></o:p></p>
        <p class="MsoNormal"><br>
          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.<br>
          <br>
          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.<br>
          But if A response was the last received, then c-ares ignored
          the bad AAAA response and the host resolution was successful.<br>
          <br>
          I looked at the c-ares code, and found the problem in the
          host_callback() function<span
            style="font-size:9.5pt;font-family:Consolas;color:#880000">
          </span> (src\lib\ares_getaddrinfo.c: 528)<br>
          <br>
          <o:p></o:p></p>
      </div>
    </blockquote>
    ...<br>
    <blockquote type="cite"
cite="mid:BYAPR01MB5606813309D80AB8DDAB0219C3F49@BYAPR01MB5606.prod.exchangelabs.com">
      <div class="WordSection1">
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">When there are no remaining queries, the
          ARES_EBADRESP parsing error is reported immediately, even
          though the previous query might be successful.<br>
        </p>
      </div>
    </blockquote>
    ...<span style="font-size:9.5pt;font-family:Consolas;color:black"></span><br>
    <span style="font-size:9.5pt;font-family:Consolas;color:black"></span>
    <blockquote type="cite"
cite="mid:BYAPR01MB5606813309D80AB8DDAB0219C3F49@BYAPR01MB5606.prod.exchangelabs.com">
      <div class="WordSection1">
        <p class="MsoNormal"><span
            style="font-size:9.5pt;font-family:Consolas;color:black">
          </span>I am also attaching a patch file with the potential
          fix.<br>
          <br>
          Thanks,<br>
          Dmitry Karpov<br>
        </p>
      </div>
    </blockquote>
    <br>
    <br>
    Thanks! This patch has been applied to main.<br>
    <br>
    -Brad<br>
  </body>
</html>