cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: debians ipv6/c-ares patch

From: Phil Blundell <pb_at_reciva.com>
Date: Tue, 08 Jul 2008 11:41:54 +0100

On Tue, 2008-07-08 at 11:49 +0200, Daniel Stenberg wrote:
> Here's my rework of the patch, mainly to address these two issues:
>
> 1 - alloca() isn't really portable and must not be used
>
> 2 - this code now attempts to acknowledge the -4/-6 options, known as
> CURL_IPRESOLVE_* in libcurl
>
> If someone could just verify that this works on IPv6-enabled hosts, I'd also
> like to move the Curl_he2ai() function from hostip4.c since that is now used
> even for ipv6 systems. Thus it seems more suitably placed in hostip.c.

Excellent. Thanks for that.

It looks like one line got lost from Curl_ip2addr6(); it needs:

--- hostares.c~ 2008-07-08 11:29:09.000000000 +0100
+++ hostares.c 2008-07-08 11:39:17.000000000 +0100
@@ -339,6 +339,7 @@
   h->h_addr_list[0] = (char*)addrentry;
   h->h_name = &buf->hostname[0];
   h->h_aliases = NULL;
+ h->h_addrtype = AF_INET6;
 
   /* Now store the dotted version of the address */
   strcpy (h->h_name, hostname);

Other than that, your patch seemed to work fine in my limited testing.

p.
Received on 2008-07-08