cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Re: IPv6 Support

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 11 Dec 2008 22:56:27 +0100 (CET)

On Thu, 11 Dec 2008, keshav krity wrote:

> I require to connect to IP of the following format.
> http://[2001:1890:110b:151e:20d:56ff:254.197.153.216]

I could repeat a problem with that very IP in the most recent libcurl, and I
can fix it with this patch below.

45 is the maximum IPv6 dotted address length I believe, as used in an address
like:

         "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"

The address used above is 44 bytes long.

diff -u -r1.774 url.c
--- lib/url.c 10 Dec 2008 23:13:31 -0000 1.774
+++ lib/url.c 11 Dec 2008 21:52:58 -0000
@@ -3724,7 +3724,8 @@
    char *portptr;
    char endbracket;

- if((1 == sscanf(conn->host.name, "[%*39[0123456789abcdefABCDEF:.%]%c",
&endbracket)) &&
+ if((1 == sscanf(conn->host.name, "[%*45[0123456789abcdefABCDEF:.%]%c",
+ &endbracket)) &&
       (']' == endbracket)) {
      /* this is a RFC2732-style specified IP-address */
      conn->bits.ipv6_ip = TRUE;

-- 
  / daniel.haxx.se
Received on 2008-12-11