[uClibc 0000660]: getaddrinfo() queries are redundant and in odd order

bugs at busybox.net bugs at busybox.net
Thu Jan 26 03:04:08 UTC 2006


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=660 
====================================================================== 
Reported By:                akvadrako
Assigned To:                uClibc
====================================================================== 
Project:                    uClibc
Issue ID:                   660
Category:                   Networking Support
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             01-25-2006 16:52 PST
Last Modified:              01-25-2006 19:04 PST
====================================================================== 
Summary:                    getaddrinfo() queries are redundant and in odd order
Description: 
I have IPv6 support enabled and three DNS servers listed in
/etc/resolv.conf.  I'm looking up a hostname that only has an A record. 
uClibc's getaddrinfo() looks up the records by trying each nameserver in
order then trying again two more times.  When the family is AF_UNSPEC, it
completes this process for AAAA records then A records.

So in my case, to get the A record, I have to wait for 9 queries to fail
first.  Since they timeout in ten seconds, this is unacceptably long if
some of the DNS servers are down.

To make the situation worse, getaddrinfo() doesn't trust query responses
with no answers.  Instead it treats them as an error, and repeats the
query, even to the same host.

RFC1035 recommends retransmissions (but not timeouts) every 2-5 seconds. 
I suggest three changes to the current lookup method:

  * trust the first response without an error, even if negative
  * ask for both type of records in each query (adds negligable size)
  * retransmit every 5 seconds, not every 10
====================================================================== 

---------------------------------------------------------------------- 
 vapier - 01-25-06 19:04  
---------------------------------------------------------------------- 
can you try the patch in Bug 473:
http://busybox.net/bugs/file_download.php?file_id=389&type=bug 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
01-25-06 16:52  akvadrako      New Issue                                    
01-25-06 16:52  akvadrako      Status                   new => assigned     
01-25-06 16:52  akvadrako      Assigned To               => uClibc          
01-25-06 19:04  vapier         Note Added: 0001005                          
======================================================================




More information about the uClibc-cvs mailing list