cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: [ curl-Bugs-530204 ] curl 7.9.5 does not support IPv6

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 15 Mar 2002 09:39:43 +0100 (MET)

Argh.

This bug report that was filed just now, troubles me:

> Bugs item #530204, was opened at 2002-03-15 00:17
> http://sourceforge.net/tracker/?func=detail&atid=100976&aid=530204&group_id=976

   due to the change in lib/hostip.c (revision 1.52), curl 7.9.5 does not
   support IPv6 at all. please revert the change.

The change this report speaks of is this:

@@ -292,7 +292,7 @@
   char sbuf[NI_MAXSERV];

   memset(&hints, 0, sizeof(hints));
- hints.ai_family = PF_UNSPEC;
+ hints.ai_family = PF_INET;
   hints.ai_socktype = SOCK_STREAM;
   hints.ai_flags = AI_CANONNAME;
   snprintf(sbuf, sizeof(sbuf), "%d", port);

And why does this trouble me? If I had any intelligence in my brain I
should've realized that "PF_INET" is for IPv4 and thus this don't get any
IPv6 names anymore with this fix.

But! (there's always a but) Rick Richardson found out that his Linux box
(running kernel 2.4.9 and glibc 2.2.4, without running it IPv6-enabled) did
extremely slow name lookups when using the PF_UNSPEC in there.

Full details are in this thread:
        http://curl.haxx.se/mail/archive-2002-02/0077.html

So, to make it work with IPv6 again I have to revert the above change. But
then we will get back to slow name resolves on certain machines. Until proven
wrong, I will blame this latter situation on glibc.

Anyone with a nice and clean solution to this dilemma? We can hardly be the
first to face this.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2002-03-15