Bug 59999 - Slow DNS resolution with curl when ipv6 is enabled and getaddrinfo is used
Slow DNS resolution with curl when ipv6 is enabled and getaddrinfo is used
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: curl (Show other bugs)
7.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Trond Eivind Glomsrxd
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-02-18 14:47 EST by Rick Richardson
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-03-01 15:33:02 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
C program which demostrates the problem with using getaddrinfo() in curl (645 bytes, text/plain)
2002-02-18 14:50 EST, Rick Richardson
no flags Details
Fix from CVS (392 bytes, patch)
2002-02-24 20:21 EST, Peter Bowen
no flags Details | Diff

  None (edit)
Description Rick Richardson 2002-02-18 14:47:44 EST
The "curl" configure script automatically detects that there is ipv6 support and
therefore tries to use getaddrinfo() with ai_family set to PF_UNSPEC in order to
do name resolution.

The problem is, this causes extremely slow name resolution (> 10 secs) for some
(but not all) names. The problem is demostrated with the attached test program
(derived from the curl sources when ipv6 is enabled).

You can repro the problem with the test program (make getaddrinfo):

	$ ./getaddrinfo www.yahoo.com www.bloomberg.com
	www.yahoo.com: rc = 0, time = 1 secs
	www.bloomberg.com: rc = 0, time = 28 secs

The time for resolving www.bloomberg.com will be approximately 10 * (number of
nameservers in /etc/resolv.conf) seconds.  In my case, I have 3 nameservers, so
~30 seconds of delay.

Or, you can repro the problem using curl itself to fetch a page from
www.bloomberg.com.

I've had my friends check this with the same results (even on FreeBSD).

I think the bottom line is that Redhat needs to ship "curl" binaries that have
been configured
with --disable-ipv6.  I dunno who has the high ground here, but it is
unacceptable to have
these kinds of delays.
Comment 1 Rick Richardson 2002-02-18 14:50:14 EST
Created attachment 45903 [details]
C program which demostrates the problem with using getaddrinfo() in curl
Comment 2 Peter Bowen 2002-02-24 20:21:13 EST
Created attachment 46561 [details]
Fix from CVS
Comment 3 Trond Eivind Glomsrxd 2002-03-01 15:20:55 EST
Is this still a problem with curl 7.9.3?
Comment 4 Rick Richardson 2002-03-01 15:32:58 EST
Yes, its broken in curl 7.9.3 if compiled with ipv6 support.  Basically, its
broken
if PF_UNSPEC is passed to getaddrinfo().  The curl author has decided to
blow off ipv6 support and change the call to PF_INET, in some future version
of curl that is not yet released.
Comment 5 Trond Eivind Glomsrxd 2002-03-08 11:30:35 EST
curl 7.9.5 has the fix and has been built (curl-7.9.5-1)

Note You need to log in before you can comment on or make changes to this bug.