|
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 __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), while the other server subsequently replied with the correct IP address(behind the first server). 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 && alens[i]>0; i++);
if (i==nqueries) break;
if (t2-t1 >= retry_interval) {
/* Query all configured namservers in parallel */
for (i=0; i<nqueries; i++)
if (!alens[i])
for (j=0; j<nns; j++) // 2 nameservers
sendto(fd, queries[i],
qlens[i], MSG_NOSIGNAL,
(void *)&ns[j], sl);
t1 = t2;
servfail_retry = 2 * nqueries;
}
switch (answers[next][3] & 15) { case 0:
case 3:
break;
case 2:
if (servfail_retry && servfail_retry--)
sendto(fd, queries[i],
qlens[i], MSG_NOSIGNAL,
(void *)&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; // choose the reply with no such name and will ignore the reply later with right IP
if (i == next)
for (; next<nqueries && 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;
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.