curl-library
Re: Re: IPv6 Support
Date: 11 Dec 2008 14:45:45 -0000
Hi,
Thanks for the reply. My apologies for not mentioning the system details.
I am using curl 3.x version on a linux(fedora 8).
There are many formats of IPv6-IPv4 mixed addressing.
I require to connect to IP of the following format.
http://[2001:1890:110b:151e:20d:56ff:254.197.153.216]
Browser(Mozilla) is able to resolve this link.
But libcurl gives -> getaddrinfo(3) failed.
Any idea why is it not working for this format ?
Thanking you
KeshavK
On Wed, 10 Dec 2008 Phil Blundell wrote :
>On Wed, 2008-12-10 at 13:25 +0000, keshav krity wrote:
> > Does lib-curl support mixed addressing of the format that has IPv4
> > address embedded into the an IPv6 address. Example :
> > 805B:2D9D:DC28::FC57:212.200.31.255
>
>You didn't mention what OS you are using, what version of libcurl you
>have, or what resolver library it was configured to use, so it is
>difficult to say exactly what would be causing your problem. However,
>addresses in this form do work OK for me using c-ares under Linux:
>
>$ strace -f ./curl -g http://[805B:2D9D:DC28::FC57:212.200.31.255]/ 2>&1
>|grep 805b
>connect(3, {sa_family=AF_INET6, sin6_port=htons(80), inet_pton(AF_INET6,
>"805b:2d9d:dc28::fc57:d4c8:1fff", &sin6_addr), sin6_flowinfo=0,
>sin6_scope_id=0}, 28) = -1 EINPROGRESS (Operation now in progress)
>$
>
>p.
>
Hi All,
Does lib-curl support mixed addressing of the format that has IPv4 address embedded into the an IPv6 address. Example : 805B:2D9D:DC28::FC57:212.200.31.255
This is the sample code that I wrote
#include <stdio.h>
#include <curl/curl.h>
int main(void)
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "/*any mixed address*/");
curl_easy_setopt( curl, CURLOPT_VERBOSE, 1 );
res = curl_easy_perform(curl);
/* always cleanup */
curl_easy_cleanup(curl);
}
return 0;
}
When I provide pure IPv6 address it works fine but when I try with mixed address as mentioned above I get the following
*error.getaddrinfo(3) failed for IP: ...
* Couldn't resolve host
* Closing connection #0
* couldn't resolve host name
Is there a problem in the way I am implementing or is mixed addressing not supported by lib-curl?
Received on 2008-12-11