Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_769DDAE8896201C9B03015B97D45CA4CCD06@qq.com>
Date: Fri, 14 Jun 2024 21:28:18 +0800
From: "AK47" <250200715@...com>
To: "musl" <musl@...ts.openwall.com>
Subject: Question about res_msend_rc

Hi,
      In&nbsp;__res_msend_rc functions, if we send two A queries to two nameservers, One server first replied with ret code "no such name"(answer length is greater than 4),&nbsp; while the other server subsequently replied with the correct IP address(behind the first server).&nbsp;Will the current musl only capture the first "no such name" reply and totally miss the correct IP address reply? Is there a bug or any special reason?



      for (; t2-t0 < timeout; t2=mtime()) {            /* This is the loop exit condition: that all queries
             * have an accepted answer. */
            for (i=0; i<nqueries &amp;&amp; alens[i]&gt;0; i++);
            if (i==nqueries) break;


            if (t2-t1 &gt;= retry_interval) {
                  /* Query all configured namservers in parallel */
                  for (i=0; i<nqueries; i++)
                        if (!alens[i])
                              for (j=0; j<nns; j++)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // 2 nameservers
                                    sendto(fd, queries[i],
                                          qlens[i], MSG_NOSIGNAL,
                                          (void *)&amp;ns[j], sl);
                  t1 = t2;
                  servfail_retry = 2 * nqueries;
            }







                  switch (answers[next][3] &amp; 15) {                  case 0:
                  case 3:
                        break;
                  case 2:
                        if (servfail_retry &amp;&amp; servfail_retry--)
                              sendto(fd, queries[i],
                                    qlens[i], MSG_NOSIGNAL,
                                    (void *)&amp;ns[j], sl);
                  default:
                        continue;
                  }


                  /* Store answer in the right slot, or update next
                   * available temp slot if it's already in place. */
                  alens[i] = rlen;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // choose the reply with no such name and will ignore the reply later with right IP
                  if (i == next)
                        for (; next<nqueries &amp;&amp; alens[next]; next++); // choose the reply with no such name ret code
                  else
                        memcpy(answers[i], answers[next], rlen);


                  /* Ignore further UDP if all slots full or TCP-mode */
                  if (next == nqueries) pfd[nqueries].events = 0;&nbsp;



Thanks
Li
Content of type "text/html" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.