Bug 59999

Summary: Slow DNS resolution with curl when ipv6 is enabled and getaddrinfo is used
Product: [Retired] Red Hat Linux Reporter: Rick Richardson <rickrich>
Component: curlAssignee: Trond Eivind Glomsrxd <teg>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-03-01 20:33:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
C program which demostrates the problem with using getaddrinfo() in curl
none
Fix from CVS none

Description Rick Richardson 2002-02-18 19:47:44 UTC
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 19:50:14 UTC
Created attachment 45903 [details]
C program which demostrates the problem with using getaddrinfo() in curl

Comment 2 Peter Bowen 2002-02-25 01:21:13 UTC
Created attachment 46561 [details]
Fix from CVS

Comment 3 Trond Eivind Glomsrxd 2002-03-01 20:20:55 UTC
Is this still a problem with curl 7.9.3?

Comment 4 Rick Richardson 2002-03-01 20:32:58 UTC
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 16:30:35 UTC
curl 7.9.5 has the fix and has been built (curl-7.9.5-1)