diff options
author | Marc Hoersken <info@marc-hoersken.de> | 2012-09-14 08:12:07 +0200 |
---|---|---|
committer | Marc Hoersken <info@marc-hoersken.de> | 2012-09-14 08:12:07 +0200 |
commit | 5162cb8ad6a5bad25cbe51b7fadaff757daeb647 (patch) | |
tree | 21e54509d8dfd150181fa3127cc270725e81e042 /lib/socks.c | |
parent | 8a2be299f4c91a87014b35bcf6b75f91ab477262 (diff) | |
download | curl-5162cb8ad6a5bad25cbe51b7fadaff757daeb647.tar.gz |
socks.c: Check that IPv6 is enabled before using it's features
Diffstat (limited to 'lib/socks.c')
-rw-r--r-- | lib/socks.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/socks.c b/lib/socks.c index 5d5ca48a9..c857f7a82 100644 --- a/lib/socks.c +++ b/lib/socks.c @@ -588,7 +588,9 @@ CURLcode Curl_SOCKS5(const char *proxy_name, hp=dns->addr; if(hp) { struct sockaddr_in *saddr_in; +#ifdef ENABLE_IPV6 struct sockaddr_in6 *saddr_in6; +#endif int i; if(hp->ai_family == AF_INET) { @@ -600,6 +602,7 @@ CURLcode Curl_SOCKS5(const char *proxy_name, infof(data, "%d\n", socksreq[len-1]); } } +#ifdef ENABLE_IPV6 else if(hp->ai_family == AF_INET6) { socksreq[len++] = 4; /* ATYP: IPv6 = 4 */ @@ -608,6 +611,7 @@ CURLcode Curl_SOCKS5(const char *proxy_name, socksreq[len++] = ((unsigned char*)&saddr_in6->sin6_addr.s6_addr)[i]; } } +#endif else hp = NULL; /* fail! */ |