Bug 59999 - Slow DNS resolution with curl when ipv6 is enabled and getaddrinfo is used
Summary: Slow DNS resolution with curl when ipv6 is enabled and getaddrinfo is used
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: curl (Show other bugs)
(Show other bugs)
Version: 7.2
Hardware: i386 Linux
medium
medium
Target Milestone: ---
Assignee: Trond Eivind Glomsrxd
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-02-18 19:47 UTC by Rick Richardson
Modified: 2008-05-01 15:38 UTC (History)
0 users

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: ---


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

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)


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