list(APPEND CURL_LIBS "-framework SystemConfiguration")
endif()
endif()
+if(ENABLE_IPV6)
+ set(USE_IPV6 ON)
+endif()
find_package(Perl)
if test "$ipv6" = yes; then
curl_ipv6_msg="enabled"
- AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support])
+ AC_DEFINE(USE_IPV6, 1, [Define if you want to enable IPv6 support])
IPV6_ENABLED=1
AC_SUBST(IPV6_ENABLED)
endif
ifneq ($(findstring -ipv6,$(CFG)),)
- CPPFLAGS += -DENABLE_IPV6
+ CPPFLAGS += -DUSE_IPV6
endif
ifneq ($(findstring -watt,$(CFG))$(MSDOS),)
CURLcode result = Curl_gmtime(as->expires, &stamp);
if(result)
return result;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
else {
char ipv6_unused[16];
if(1 == Curl_inet_pton(AF_INET6, as->dst.host, ipv6_unused)) {
if(!ai)
return;
-#ifdef ENABLE_IPV6 /* CURLRES_IPV6 */
+#ifdef USE_IPV6 /* CURLRES_IPV6 */
if(res->temp_ai && res->temp_ai->ai_family == PF_INET6) {
/* We have results already, put the new IPv6 entries at the head of the
list. */
/* settle family-specific sockaddr structure size. */
if(ai->ai_family == AF_INET)
ss_size = sizeof(struct sockaddr_in);
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
else if(ai->ai_family == AF_INET6)
ss_size = sizeof(struct sockaddr_in6);
#endif
CURLcode Curl_set_dns_local_ip6(struct Curl_easy *data,
const char *local_ip6)
{
-#if defined(HAVE_CARES_SET_LOCAL) && defined(ENABLE_IPV6)
+#if defined(HAVE_CARES_SET_LOCAL) && defined(USE_IPV6)
unsigned char a6[INET6_ADDRSTRLEN];
if((!local_ip6) || (local_ip6[0] == 0)) {
/* settle family-specific sockaddr structure size. */
if(ai->ai_family == AF_INET)
ss_size = sizeof(struct sockaddr_in);
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
else if(ai->ai_family == AF_INET6)
ss_size = sizeof(struct sockaddr_in6);
#endif
/*
* getaddrinfo_thread() resolves a name and then exits.
*
- * For builds without ARES, but with ENABLE_IPV6, create a resolver thread
+ * For builds without ARES, but with USE_IPV6, create a resolver thread
* and wait on it.
*/
static unsigned int CURL_STDCALL getaddrinfo_thread(void *arg)
#include "memdebug.h"
-#if defined(ENABLE_IPV6) && defined(IPV6_V6ONLY) && defined(_WIN32)
+#if defined(USE_IPV6) && defined(IPV6_V6ONLY) && defined(_WIN32)
/* It makes support for IPv4-mapped IPv6 addresses.
* Linux kernel, NetBSD, FreeBSD and Darwin: default is off;
* Windows Vista and later: default is on;
/* no socket, no connection */
return CURLE_COULDNT_CONNECT;
-#if defined(ENABLE_IPV6) && defined(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID)
+#if defined(USE_IPV6) && defined(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID)
if(data->conn->scope_id && (addr->family == AF_INET6)) {
struct sockaddr_in6 * const sa6 = (void *)&addr->sa_addr;
sa6->sin6_scope_id = data->conn->scope_id;
struct sockaddr *sock = (struct sockaddr *)&sa; /* bind to this address */
curl_socklen_t sizeof_sa = 0; /* size of the data sock points to */
struct sockaddr_in *si4 = (struct sockaddr_in *)&sa;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
struct sockaddr_in6 *si6 = (struct sockaddr_in6 *)&sa;
#endif
#ifdef IP_BIND_ADDRESS_NO_PORT
int on = 1;
#endif
-#ifndef ENABLE_IPV6
+#ifndef USE_IPV6
(void)scope;
#endif
#endif
switch(Curl_if2ip(af,
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
scope, conn->scope_id,
#endif
dev, myhost, sizeof(myhost))) {
if(af == AF_INET)
conn->ip_version = CURL_IPRESOLVE_V4;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
else if(af == AF_INET6)
conn->ip_version = CURL_IPRESOLVE_V6;
#endif
}
if(done > 0) {
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
/* IPv6 address */
if(af == AF_INET6) {
#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
}
else {
/* no device was given, prepare sa to match af's needs */
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(af == AF_INET6) {
si6->sin6_family = AF_INET6;
si6->sin6_port = htons(port);
/* We reuse/clobber the port variable here below */
if(sock->sa_family == AF_INET)
si4->sin_port = ntohs(port);
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
else
si6->sin6_port = ntohs(port);
#endif
if(result)
goto out;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(ctx->addr.family == AF_INET6) {
set_ipv6_v6only(ctx->sock, 0);
infof(data, " Trying [%s]:%d...", ctx->ip.remote_ip, ctx->ip.remote_port);
#endif
infof(data, " Trying %s:%d...", ctx->ip.remote_ip, ctx->ip.remote_port);
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
is_tcp = (ctx->addr.family == AF_INET
|| ctx->addr.family == AF_INET6) &&
ctx->addr.socktype == SOCK_STREAM;
#ifndef CURL_DISABLE_BINDLOCAL
/* possibly bind the local end to an IP, interface or port */
if(ctx->addr.family == AF_INET
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
|| ctx->addr.family == AF_INET6
#endif
) {
/* the first socket info gets some specials */
if(cf->sockindex == FIRSTSOCKET) {
cf->conn->remote_addr = &ctx->addr;
- #ifdef ENABLE_IPV6
+ #ifdef USE_IPV6
cf->conn->bits.ipv6 = (ctx->addr.family == AF_INET6)? TRUE : FALSE;
#endif
Curl_persistconninfo(data, cf->conn, &ctx->ip);
#undef NEED_REENTRANT
/* Define if you want to enable IPv6 support */
-#define ENABLE_IPV6
+#define USE_IPV6
/* Define if struct sockaddr_in6 has the sin6_scope_id member */
#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
#define CURL_CA_BUNDLE "/sys/lib/tls/ca.pem"
#define CURL_CA_PATH "/sys/lib/tls"
#define CURL_STATICLIB 1
-#define ENABLE_IPV6 1
+#define USE_IPV6 1
#define CURL_DISABLE_LDAP 1
#define NEED_REENTRANT 1
#undef NEED_REENTRANT
/* Define if you want to enable IPv6 support */
-#undef ENABLE_IPV6
+#undef USE_IPV6
/* Define if struct sockaddr_in6 has the sin6_scope_id member */
#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
/* Define this as a suitable file to read random data from */
#undef RANDOM_FILE
-/* Define if you want to enable IPv6 support */
-#undef ENABLE_IPV6
-
/* Define if you have the alarm function. */
#define HAVE_ALARM
/* If you want to build curl with the built-in manual */
#define USE_MANUAL 1
-#if defined(USE_IPV6)
-# define ENABLE_IPV6 1
-#endif
-
#endif /* HEADER_CURL_CONFIG_WIN32_H */
hostname = conn->host.name;
/* put the numbers first so that the hostname gets cut off if too long */
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
msnprintf(buf, len, "%u/%ld/%s", conn->scope_id, port, hostname);
#else
msnprintf(buf, len, "%ld/%s", port, hostname);
char *addr, int *port)
{
struct sockaddr_in *si = NULL;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
struct sockaddr_in6 *si6 = NULL;
#endif
#if (defined(HAVE_SYS_UN_H) || defined(WIN32_SOCKADDR_UN)) && defined(AF_UNIX)
return TRUE;
}
break;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
case AF_INET6:
si6 = (struct sockaddr_in6 *)(void *) sa;
if(Curl_inet_ntop(sa->sa_family, &si6->sin6_addr,
return CURLE_OUT_OF_MEMORY;
baller->name = ((ai_family == AF_INET)? "ipv4" : (
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
(ai_family == AF_INET6)? "ipv6" :
#endif
"ip"));
/* any IP version is allowed */
ai_family0 = remotehost->addr?
remotehost->addr->ai_family : 0;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
ai_family1 = ai_family0 == AF_INET6 ?
AF_INET : AF_INET6;
#else
/* only one IP version is allowed */
ai_family0 = (conn->ip_version == CURL_IPRESOLVE_V4) ?
AF_INET :
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
AF_INET6;
#else
AF_UNSPEC;
/* settle family-specific sockaddr structure size. */
if(ai->ai_family == AF_INET)
ss_size = sizeof(struct sockaddr_in);
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
else if(ai->ai_family == AF_INET6)
ss_size = sizeof(struct sockaddr_in6);
#endif
struct Curl_addrinfo *prevai = NULL;
struct Curl_addrinfo *firstai = NULL;
struct sockaddr_in *addr;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
struct sockaddr_in6 *addr6;
#endif
CURLcode result = CURLE_OK;
for(i = 0; (curr = he->h_addr_list[i]) != NULL; i++) {
size_t ss_size;
size_t namelen = strlen(he->h_name) + 1; /* include null-terminator */
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(he->h_addrtype == AF_INET6)
ss_size = sizeof(struct sockaddr_in6);
else
addr->sin_port = htons((unsigned short)port);
break;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
case AF_INET6:
addr6 = (void *)ai->ai_addr; /* storage area for this info */
struct hostent hostentry;
union {
struct in_addr ina4;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
struct in6_addr ina6;
#endif
} addrentry;
addrentry = (void *)&buf->addrentry.ina4;
memcpy(addrentry, inaddr, sizeof(struct in_addr));
break;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
case AF_INET6:
addrsize = sizeof(struct in6_addr);
addrentry = (void *)&buf->addrentry.ina6;
if(Curl_inet_pton(AF_INET, address, &in) > 0)
/* This is a dotted IP address 123.123.123.123-style */
return Curl_ip2addr(AF_INET, &in, address, port);
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
{
struct in6_addr in6;
if(Curl_inet_pton(AF_INET6, address, &in6) > 0)
{
struct Curl_addrinfo *ca;
struct sockaddr_in *addr;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
struct sockaddr_in6 *addr6;
#endif
for(ca = addrinfo; ca != NULL; ca = ca->ai_next) {
addr->sin_port = htons((unsigned short)port);
break;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
case AF_INET6:
addr6 = (void *)ca->ai_addr; /* storage area for this info */
addr6->sin6_port = htons((unsigned short)port);
#cmakedefine USE_WIN32_LDAP 1
/* Define if you want to enable IPv6 support */
-#cmakedefine ENABLE_IPV6 1
+#cmakedefine USE_IPV6 1
/* Define to 1 if you have the alarm function. */
#cmakedefine HAVE_ALARM 1
# endif
#endif
+/* Compatibility */
+#if defined(ENABLE_IPV6)
+# define USE_IPV6 1
+#endif
+
/*
* Include configuration script results or hand-crafted
* configuration file for platforms which lack config tool.
#include <TargetConditionals.h>
#define USE_RESOLVE_ON_IPS 1
# if TARGET_OS_MAC && !(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) && \
- defined(ENABLE_IPV6)
+ defined(USE_IPV6)
# define CURL_MACOS_CALL_COPYPROXIES 1
# endif
#endif
* Mutually exclusive CURLRES_* definitions.
*/
-#if defined(ENABLE_IPV6) && defined(HAVE_GETADDRINFO)
+#if defined(USE_IPV6) && defined(HAVE_GETADDRINFO)
# define CURLRES_IPV6
-#elif defined(ENABLE_IPV6) && (defined(_WIN32) || defined(__CYGWIN__))
+#elif defined(USE_IPV6) && (defined(_WIN32) || defined(__CYGWIN__))
/* assume on Windows that IPv6 without getaddrinfo is a broken build */
# error "Unexpected build: IPv6 is enabled but getaddrinfo was not found."
#else
goto error;
dohp->pending++;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if((conn->ip_version != CURL_IPRESOLVE_V4) && Curl_ipv6works(data)) {
/* create IPv6 DoH request */
result = dohprobe(data, &dohp->probe[DOH_PROBE_SLOT_IPADDR_V6],
struct Curl_addrinfo *prevai = NULL;
struct Curl_addrinfo *firstai = NULL;
struct sockaddr_in *addr;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
struct sockaddr_in6 *addr6;
#endif
CURLcode result = CURLE_OK;
size_t ss_size;
CURL_SA_FAMILY_T addrtype;
if(de->addr[i].type == DNS_TYPE_AAAA) {
-#ifndef ENABLE_IPV6
+#ifndef USE_IPV6
/* we can't handle IPv6 addresses */
continue;
#else
addr->sin_port = htons((unsigned short)port);
break;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
case AF_INET6:
addr6 = (void *)ai->ai_addr; /* storage area for this info */
DEBUGASSERT(sizeof(struct in6_addr) == sizeof(de->addr[i].ip.v6));
struct connectdata *conn = data->conn;
curl_socket_t sock = conn->sock[SECONDARYSOCKET];
curl_socket_t s = CURL_SOCKET_BAD;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
struct Curl_sockaddr_storage add;
#else
struct sockaddr_in add;
char hbuf[NI_MAXHOST];
struct sockaddr *sa = (struct sockaddr *)&ss;
struct sockaddr_in * const sa4 = (void *)sa;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
struct sockaddr_in6 * const sa6 = (void *)sa;
#endif
static const char mode[][5] = { "EPRT", "PORT" };
(strlen(data->set.str[STRING_FTPPORT]) > 1)) {
char *ip_end = NULL;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(*string_ftpport == '[') {
/* [ipv6]:port(-range) */
char *ip_start = string_ftpport + 1;
if(ip_end) {
/* either ipv6 or (ipv4|domain|interface):port(-range) */
addrlen = ip_end - string_ftpport;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(Curl_inet_pton(AF_INET6, string_ftpport, &sa6->sin6_addr) == 1) {
/* ipv6 */
port_min = port_max = 0;
/* attempt to get the address of the given interface name */
switch(Curl_if2ip(conn->remote_addr->family,
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
Curl_ipv6_scope(&conn->remote_addr->sa_addr),
conn->scope_id,
#endif
goto out;
}
switch(sa->sa_family) {
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
case AF_INET6:
r = Curl_inet_ntop(sa->sa_family, &sa6->sin6_addr, hbuf, sizeof(hbuf));
break;
for(port = port_min; port <= port_max;) {
if(sa->sa_family == AF_INET)
sa4->sin_port = htons(port);
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
else
sa6->sin6_port = htons(port);
#endif
below */
Curl_printable_address(ai, myhost, sizeof(myhost));
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(!conn->bits.ftp_use_eprt && conn->bits.ipv6)
/* EPRT is disabled but we are connected to a IPv6 host, so we ignore the
request and enable EPRT again! */
case AF_INET:
port = ntohs(sa4->sin_port);
break;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
case AF_INET6:
port = ntohs(sa6->sin6_port);
break;
(void)Curl_inet_ntop(ai->ai_family, (const void *)ipaddr4, buf, bufsize);
break;
}
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
case AF_INET6: {
const struct sockaddr_in6 *sa6 = (const void *)ai->ai_addr;
const struct in6_addr *ipaddr6 = &sa6->sin6_addr;
return dns;
}
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
/* return a static IPv6 ::1 for the name */
static struct Curl_addrinfo *get_localhost6(int port, const char *name)
{
return ca6;
}
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
/*
* Curl_ipv6works() returns TRUE if IPv6 seems to work.
*/
return (ipv6_works>0)?TRUE:FALSE;
}
}
-#endif /* ENABLE_IPV6 */
+#endif /* USE_IPV6 */
/*
* Curl_host_is_ipnum() returns TRUE if the given string is a numerical IPv4
bool Curl_host_is_ipnum(const char *hostname)
{
struct in_addr in;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
struct in6_addr in6;
#endif
if(Curl_inet_pton(AF_INET, hostname, &in) > 0
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
|| Curl_inet_pton(AF_INET6, hostname, &in6) > 0
#endif
)
if(!addr)
return CURLRESOLV_ERROR;
}
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
else {
struct in6_addr in6;
/* check if this is an IPv6 address string */
return CURLRESOLV_ERROR;
}
}
-#endif /* ENABLE_IPV6 */
+#endif /* USE_IPV6 */
#else /* if USE_RESOLVE_ON_IPS */
#ifndef CURL_DISABLE_DOH
if(Curl_inet_pton(AF_INET, hostname, &in) > 0)
/* This is a dotted IP address 123.123.123.123-style */
ipnum = TRUE;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
else {
struct in6_addr in6;
/* check if this is an IPv6 address string */
/* This is an IPv6 address literal */
ipnum = TRUE;
}
-#endif /* ENABLE_IPV6 */
+#endif /* USE_IPV6 */
#endif /* CURL_DISABLE_DOH */
#endif /* !USE_RESOLVE_ON_IPS */
memcpy(address, addr_begin, alen);
address[alen] = '\0';
-#ifndef ENABLE_IPV6
+#ifndef USE_IPV6
if(strchr(address, ':')) {
infof(data, "Ignoring resolve address '%s', missing IPv6 support.",
address);
struct Curl_dns_entry **dnsentry,
timediff_t timeoutms);
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
/*
* Curl_ipv6works() returns TRUE if IPv6 seems to work.
*/
/* ------------------------------------------------------------------ */
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
/* Return the scope of the given address. */
unsigned int Curl_ipv6_scope(const struct sockaddr *sa)
{
#if defined(HAVE_GETIFADDRS)
if2ip_result_t Curl_if2ip(int af,
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
unsigned int remote_scope,
unsigned int local_scope_id,
#endif
struct ifaddrs *iface, *head;
if2ip_result_t res = IF2IP_NOT_FOUND;
-#if defined(ENABLE_IPV6) && \
+#if defined(USE_IPV6) && \
!defined(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID)
(void) local_scope_id;
#endif
const char *ip;
char scope[12] = "";
char ipstr[64];
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(af == AF_INET6) {
#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
unsigned int scopeid = 0;
#elif defined(HAVE_IOCTL_SIOCGIFADDR)
if2ip_result_t Curl_if2ip(int af,
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
unsigned int remote_scope,
unsigned int local_scope_id,
#endif
size_t len;
const char *r;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
(void)remote_scope;
(void)local_scope_id;
#endif
#else
if2ip_result_t Curl_if2ip(int af,
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
unsigned int remote_scope,
unsigned int local_scope_id,
#endif
char *buf, int buf_size)
{
(void) af;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
(void) remote_scope;
(void) local_scope_id;
#endif
#define IPV6_SCOPE_UNIQUELOCAL 3 /* Unique local */
#define IPV6_SCOPE_NODELOCAL 4 /* Loopback. */
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
unsigned int Curl_ipv6_scope(const struct sockaddr *sa);
#else
#define Curl_ipv6_scope(x) 0
} if2ip_result_t;
if2ip_result_t Curl_if2ip(int af,
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
unsigned int remote_scope,
unsigned int local_scope_id,
#endif
#define INT16SZ 2
/*
- * If ENABLE_IPV6 is disabled, we still want to parse IPv6 addresses, so make
+ * If USE_IPV6 is disabled, we still want to parse IPv6 addresses, so make
* sure we have _some_ value for AF_INET6 without polluting our fake value
* everywhere.
*/
-#if !defined(ENABLE_IPV6) && !defined(AF_INET6)
+#if !defined(USE_IPV6) && !defined(AF_INET6)
#define AF_INET6 (AF_INET + 1)
#endif
#define INT16SZ 2
/*
- * If ENABLE_IPV6 is disabled, we still want to parse IPv6 addresses, so make
+ * If USE_IPV6 is disabled, we still want to parse IPv6 addresses, so make
* sure we have _some_ value for AF_INET6 without polluting our fake value
* everywhere.
*/
-#if !defined(ENABLE_IPV6) && !defined(AF_INET6)
+#if !defined(USE_IPV6) && !defined(AF_INET6)
#define AF_INET6 (AF_INET + 1)
#endif
const char *network,
unsigned int bits)
{
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
int bytes;
int rest;
unsigned char address[16];
break;
#endif
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
case CURLOPT_ADDRESS_SCOPE:
/*
* Use this scope id when using IPv6
#ifdef HAVE_NETDB_H
#include <netdb.h>
#ifndef AI_NUMERICHOST
-#ifdef ENABLE_IPV6
-#undef ENABLE_IPV6
+#ifdef USE_IPV6
+#undef USE_IPV6
#endif
#endif
#endif
union {
struct sockaddr sa;
struct sockaddr_in sa_in;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
struct sockaddr_in6 sa_in6;
#endif
#ifdef HAVE_STRUCT_SOCKADDR_STORAGE
struct Curl_addrinfo *hp = NULL;
if(dns)
hp = dns->addr;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(data->set.ipver != CURL_IPRESOLVE_WHATEVER) {
int wanted_family = data->set.ipver == CURL_IPRESOLVE_V4 ?
AF_INET : AF_INET6;
infof(data, "SOCKS5 connect to %s:%d (locally resolved)", dest,
sx->remote_port);
}
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
else if(hp->ai_family == AF_INET6) {
int i;
struct sockaddr_in6 *saddr_in6;
IPv6 == 4,
IPv4 == 1 */
unsigned char ip4[4];
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(conn->bits.ipv6_ip) {
char ip6[16];
if(1 != Curl_inet_pton(AF_INET6, sx->hostname, ip6))
}
}
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
/*
* If the URL was set with an IPv6 numerical address with a zone id part, set
* the scope_id based on that!
(void)curl_url_get(uh, CURLUPART_QUERY, &data->state.up.query, 0);
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(data->set.scope_id)
/* Override any scope that was set above. */
conn->scope_id = data->set.scope_id;
/* detect and extract RFC6874-style IPv6-addresses */
if(*hostptr == '[') {
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
char *ptr = ++hostptr; /* advance beyond the initial bracket */
while(*ptr && (ISXDIGIT(*ptr) || (*ptr == ':') || (*ptr == '.')))
ptr++;
#define MAX_SCHEME_LEN 40
/*
- * If ENABLE_IPV6 is disabled, we still want to parse IPv6 addresses, so make
+ * If USE_IPV6 is disabled, we still want to parse IPv6 addresses, so make
* sure we have _some_ value for AF_INET6 without polluting our fake value
* everywhere.
*/
-#if !defined(ENABLE_IPV6) && !defined(AF_INET6)
+#if !defined(USE_IPV6) && !defined(AF_INET6)
#define AF_INET6 (AF_INET + 1)
#endif
int remote_port; /* the remote port, not the proxy port! */
int conn_to_port; /* the remote port to connect to. valid only if
bits.conn_to_port is set */
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
unsigned int scope_id; /* Scope id for IPv6 */
#endif
unsigned short localport;
unsigned int new_file_perms; /* when creating remote files */
char *str[STRING_LAST]; /* array of strings, pointing to allocated memory */
struct curl_blob *blobs[BLOB_LAST];
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
unsigned int scope_id; /* Scope id for IPv6 */
#endif
curl_prot_t allowed_protocols;
#if defined(USE_LIBIDN2) || defined(USE_WIN32_IDN)
FEATURE("IDN", idn_present, CURL_VERSION_IDN),
#endif
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
FEATURE("IPv6", NULL, CURL_VERSION_IPV6),
#endif
#ifdef USE_KERBEROS5
result = CURLE_OK;
break;
}
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
case AF_INET6: {
struct sockaddr_in6 * const sin =
(struct sockaddr_in6 * const)(void *)&addr->sa_addr;
result = CURLE_OK;
break;
}
-#endif /* ENABLE_IPV6 */
+#endif /* USE_IPV6 */
default:
/* sunsupported */
DEBUGASSERT(0);
/* Before 3.3.6, gnutls_x509_crt_check_hostname() didn't check IP
addresses. */
if(!rc) {
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
#define use_addr in6_addr
#else
#define use_addr in_addr
if(Curl_inet_pton(AF_INET, peer->hostname, addrbuf) > 0)
addrlen = 4;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
else if(Curl_inet_pton(AF_INET6, peer->hostname, addrbuf) > 0)
addrlen = 16;
#endif
int target; /* target type, GEN_DNS or GEN_IPADD */
size_t addrlen = 0;
STACK_OF(GENERAL_NAME) *altnames;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
struct in6_addr addr;
#else
struct in_addr addr;
target = GEN_IPADD;
addrlen = sizeof(struct in_addr);
break;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
case CURL_SSL_PEER_IPV6:
if(!Curl_inet_pton(AF_INET6, peer->hostname, &addr))
return CURLE_PEER_FAILED_VERIFICATION;
cr_hostname_is_ip(const char *hostname)
{
struct in_addr in;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
struct in6_addr in6;
if(Curl_inet_pton(AF_INET6, hostname, &in6) > 0) {
return true;
}
-#endif /* ENABLE_IPV6 */
+#endif /* USE_IPV6 */
if(Curl_inet_pton(AF_INET, hostname, &in) > 0) {
return true;
}
static ssl_peer_type get_peer_type(const char *hostname)
{
if(hostname && hostname[0]) {
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
struct in6_addr addr;
#else
struct in_addr addr;
#endif
if(Curl_inet_pton(AF_INET, hostname, &addr))
return CURL_SSL_PEER_IPV4;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
else if(Curl_inet_pton(AF_INET6, hostname, &addr)) {
return CURL_SSL_PEER_IPV6;
}
static const char *logdir = "log";
static char loglockfile[256];
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
static bool use_ipv6 = FALSE;
#endif
static const char *ipv_inuse = "IPv4";
/* When the specified listener port is zero, it is actually a
request to let the system choose a non-zero available port. */
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(!use_ipv6) {
#endif
memset(&listener.sa4, 0, sizeof(listener.sa4));
listener.sa4.sin_addr.s_addr = INADDR_ANY;
listener.sa4.sin_port = htons(*listenport);
rc = bind(sock, &listener.sa, sizeof(listener.sa4));
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
}
else {
memset(&listener.sa6, 0, sizeof(listener.sa6));
listener.sa6.sin6_port = htons(*listenport);
rc = bind(sock, &listener.sa, sizeof(listener.sa6));
}
-#endif /* ENABLE_IPV6 */
+#endif /* USE_IPV6 */
if(rc) {
error = SOCKERRNO;
logmsg("Error binding socket on port %hu: (%d) %s",
port we actually got and update the listener port value with it. */
curl_socklen_t la_size;
srvr_sockaddr_union_t localaddr;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(!use_ipv6)
#endif
la_size = sizeof(localaddr.sa4);
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
else
la_size = sizeof(localaddr.sa6);
#endif
case AF_INET:
*listenport = ntohs(localaddr.sa4.sin_port);
break;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
case AF_INET6:
*listenport = ntohs(localaddr.sa6.sin6_port);
break;
while(argc>arg) {
if(!strcmp("--version", argv[arg])) {
printf("mqttd IPv4%s\n",
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
"/IPv6"
#else
""
logdir = argv[arg++];
}
else if(!strcmp("--ipv6", argv[arg])) {
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
ipv_inuse = "IPv6";
use_ipv6 = TRUE;
#endif
}
else if(!strcmp("--ipv4", argv[arg])) {
/* for completeness, we support this option as well */
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
ipv_inuse = "IPv4";
use_ipv6 = FALSE;
#endif
install_signal_handlers(FALSE);
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(!use_ipv6)
#endif
sock = socket(AF_INET, SOCK_STREAM, 0);
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
else
sock = socket(AF_INET6, SOCK_STREAM, 0);
#endif
#define ERANGE 34 /* errno.h value */
#endif
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
static bool use_ipv6 = FALSE;
#endif
static const char *ipv_inuse = "IPv4";
printf("rtspd IPv4%s"
"\n"
,
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
"/IPv6"
#else
""
logdir = argv[arg++];
}
else if(!strcmp("--ipv4", argv[arg])) {
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
ipv_inuse = "IPv4";
use_ipv6 = FALSE;
#endif
arg++;
}
else if(!strcmp("--ipv6", argv[arg])) {
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
ipv_inuse = "IPv6";
use_ipv6 = TRUE;
#endif
install_signal_handlers(false);
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(!use_ipv6)
#endif
sock = socket(AF_INET, SOCK_STREAM, 0);
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
else
sock = socket(AF_INET6, SOCK_STREAM, 0);
#endif
goto server_cleanup;
}
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(!use_ipv6) {
#endif
memset(&me.sa4, 0, sizeof(me.sa4));
me.sa4.sin_addr.s_addr = INADDR_ANY;
me.sa4.sin_port = htons(port);
rc = bind(sock, &me.sa, sizeof(me.sa4));
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
}
else {
memset(&me.sa6, 0, sizeof(me.sa6));
me.sa6.sin6_port = htons(port);
rc = bind(sock, &me.sa, sizeof(me.sa6));
}
-#endif /* ENABLE_IPV6 */
+#endif /* USE_IPV6 */
if(0 != rc) {
error = SOCKERRNO;
logmsg("Error binding socket on port %hu: (%d) %s",
port we actually got and update the listener port value with it. */
curl_socklen_t la_size;
srvr_sockaddr_union_t localaddr;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(!use_ipv6)
#endif
la_size = sizeof(localaddr.sa4);
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
else
la_size = sizeof(localaddr.sa6);
#endif
case AF_INET:
port = ntohs(localaddr.sa4.sin_port);
break;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
case AF_INET6:
port = ntohs(localaddr.sa6.sin6_port);
break;
typedef union {
struct sockaddr sa;
struct sockaddr_in sa4;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
struct sockaddr_in6 sa6;
#endif
#ifdef USE_UNIX_SOCKETS
static bool verbose = FALSE;
static bool bind_only = FALSE;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
static bool use_ipv6 = FALSE;
#endif
static const char *ipv_inuse = "IPv4";
/* When the specified listener port is zero, it is actually a
request to let the system choose a non-zero available port. */
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(!use_ipv6) {
#endif
memset(&listener.sa4, 0, sizeof(listener.sa4));
listener.sa4.sin_addr.s_addr = INADDR_ANY;
listener.sa4.sin_port = htons(*listenport);
rc = bind(sock, &listener.sa, sizeof(listener.sa4));
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
}
else {
memset(&listener.sa6, 0, sizeof(listener.sa6));
listener.sa6.sin6_port = htons(*listenport);
rc = bind(sock, &listener.sa, sizeof(listener.sa6));
}
-#endif /* ENABLE_IPV6 */
+#endif /* USE_IPV6 */
if(rc) {
error = SOCKERRNO;
logmsg("Error binding socket on port %hu: (%d) %s",
port we actually got and update the listener port value with it. */
curl_socklen_t la_size;
srvr_sockaddr_union_t localaddr;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(!use_ipv6)
#endif
la_size = sizeof(localaddr.sa4);
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
else
la_size = sizeof(localaddr.sa6);
#endif
case AF_INET:
*listenport = ntohs(localaddr.sa4.sin_port);
break;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
case AF_INET6:
*listenport = ntohs(localaddr.sa6.sin6_port);
break;
while(argc>arg) {
if(!strcmp("--version", argv[arg])) {
printf("sockfilt IPv4%s\n",
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
"/IPv6"
#else
""
serverlogfile = argv[arg++];
}
else if(!strcmp("--ipv6", argv[arg])) {
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
ipv_inuse = "IPv6";
use_ipv6 = TRUE;
#endif
}
else if(!strcmp("--ipv4", argv[arg])) {
/* for completeness, we support this option as well */
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
ipv_inuse = "IPv4";
use_ipv6 = FALSE;
#endif
install_signal_handlers(false);
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(!use_ipv6)
#endif
sock = socket(AF_INET, SOCK_STREAM, 0);
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
else
sock = socket(AF_INET6, SOCK_STREAM, 0);
#endif
if(connectport) {
/* Active mode, we should connect to the given port number */
mode = ACTIVE;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(!use_ipv6) {
#endif
memset(&me.sa4, 0, sizeof(me.sa4));
Curl_inet_pton(AF_INET, addr, &me.sa4.sin_addr);
rc = connect(sock, &me.sa, sizeof(me.sa4));
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
}
else {
memset(&me.sa6, 0, sizeof(me.sa6));
rc = connect(sock, &me.sa, sizeof(me.sa6));
}
-#endif /* ENABLE_IPV6 */
+#endif /* USE_IPV6 */
if(rc) {
error = SOCKERRNO;
logmsg("Error connecting to port %hu: (%d) %s",
static enum {
socket_domain_inet = AF_INET
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
, socket_domain_inet6 = AF_INET6
#endif
#ifdef USE_UNIX_SOCKETS
listener.sa4.sin_port = htons(*listenport);
rc = bind(sock, &listener.sa, sizeof(listener.sa4));
break;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
case AF_INET6:
memset(&listener.sa6, 0, sizeof(listener.sa6));
listener.sa6.sin6_family = AF_INET6;
listener.sa6.sin6_port = htons(*listenport);
rc = bind(sock, &listener.sa, sizeof(listener.sa6));
break;
-#endif /* ENABLE_IPV6 */
+#endif /* USE_IPV6 */
#ifdef USE_UNIX_SOCKETS
case AF_UNIX:
rc = bind_unix_socket(sock, unix_socket, &listener.sau);
port we actually got and update the listener port value with it. */
curl_socklen_t la_size;
srvr_sockaddr_union_t localaddr;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(socket_domain == AF_INET6)
la_size = sizeof(localaddr.sa6);
else
case AF_INET:
*listenport = ntohs(localaddr.sa4.sin_port);
break;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
case AF_INET6:
*listenport = ntohs(localaddr.sa6.sin6_port);
break;
while(argc>arg) {
if(!strcmp("--version", argv[arg])) {
printf("socksd IPv4%s\n",
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
"/IPv6"
#else
""
reqlogfile = argv[arg++];
}
else if(!strcmp("--ipv6", argv[arg])) {
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
socket_domain = AF_INET6;
socket_type = "IPv6";
#endif
}
else if(!strcmp("--ipv4", argv[arg])) {
/* for completeness, we support this option as well */
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
socket_type = "IPv4";
#endif
arg++;
static enum {
socket_domain_inet = AF_INET
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
, socket_domain_inet6 = AF_INET6
#endif
#ifdef USE_UNIX_SOCKETS
{
switch(socket_domain) {
case AF_INET:
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
case AF_INET6:
#endif
return true;
const char *op_br = "";
const char *cl_br = "";
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(socket_domain == AF_INET6) {
op_br = "[";
cl_br = "]";
rc = connect(serverfd, &serveraddr.sa, sizeof(serveraddr.sa4));
break;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
case AF_INET6:
memset(&serveraddr.sa6, 0, sizeof(serveraddr.sa6));
serveraddr.sa6.sin6_family = AF_INET6;
rc = connect(serverfd, &serveraddr.sa, sizeof(serveraddr.sa6));
break;
-#endif /* ENABLE_IPV6 */
+#endif /* USE_IPV6 */
#ifdef USE_UNIX_SOCKETS
case AF_UNIX:
logmsg("Proxying through Unix socket is not (yet?) supported.");
while(argc>arg) {
if(!strcmp("--version", argv[arg])) {
puts("sws IPv4"
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
"/IPv6"
#endif
#ifdef USE_UNIX_SOCKETS
arg++;
}
else if(!strcmp("--ipv6", argv[arg])) {
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
socket_type = "IPv6";
socket_domain = AF_INET6;
location_str = port_str;
me.sa4.sin_port = htons(port);
rc = bind(sock, &me.sa, sizeof(me.sa4));
break;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
case AF_INET6:
memset(&me.sa6, 0, sizeof(me.sa6));
me.sa6.sin6_family = AF_INET6;
me.sa6.sin6_port = htons(port);
rc = bind(sock, &me.sa, sizeof(me.sa6));
break;
-#endif /* ENABLE_IPV6 */
+#endif /* USE_IPV6 */
#ifdef USE_UNIX_SOCKETS
case AF_UNIX:
rc = bind_unix_socket(sock, unix_socket, &me.sau);
port we actually got and update the listener port value with it. */
curl_socklen_t la_size;
srvr_sockaddr_union_t localaddr;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(socket_domain != AF_INET6)
#endif
la_size = sizeof(localaddr.sa4);
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
else
la_size = sizeof(localaddr.sa6);
#endif
case AF_INET:
port = ntohs(localaddr.sa4.sin_port);
break;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
case AF_INET6:
port = ntohs(localaddr.sa6.sin6_port);
break;
static unsigned int timeout;
static unsigned int maxtimeout = 5 * TIMEOUT;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
static bool use_ipv6 = FALSE;
#endif
static const char *ipv_inuse = "IPv4";
#endif
if(i) {
j++;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(!use_ipv6)
#endif
fromaddrlen = sizeof(fromaddr.sa4);
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
else
fromaddrlen = sizeof(fromaddr.sa6);
#endif
while(argc>arg) {
if(!strcmp("--version", argv[arg])) {
printf("tftpd IPv4%s\n",
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
"/IPv6"
#else
""
logdir = argv[arg++];
}
else if(!strcmp("--ipv4", argv[arg])) {
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
ipv_inuse = "IPv4";
use_ipv6 = FALSE;
#endif
arg++;
}
else if(!strcmp("--ipv6", argv[arg])) {
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
ipv_inuse = "IPv6";
use_ipv6 = TRUE;
#endif
install_signal_handlers(true);
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(!use_ipv6)
#endif
sock = socket(AF_INET, SOCK_DGRAM, 0);
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
else
sock = socket(AF_INET6, SOCK_DGRAM, 0);
#endif
goto tftpd_cleanup;
}
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(!use_ipv6) {
#endif
memset(&me.sa4, 0, sizeof(me.sa4));
me.sa4.sin_addr.s_addr = INADDR_ANY;
me.sa4.sin_port = htons(port);
rc = bind(sock, &me.sa, sizeof(me.sa4));
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
}
else {
memset(&me.sa6, 0, sizeof(me.sa6));
me.sa6.sin6_port = htons(port);
rc = bind(sock, &me.sa, sizeof(me.sa6));
}
-#endif /* ENABLE_IPV6 */
+#endif /* USE_IPV6 */
if(0 != rc) {
error = SOCKERRNO;
logmsg("Error binding socket on port %hu: (%d) %s", port, error,
port we actually got and update the listener port value with it. */
curl_socklen_t la_size;
srvr_sockaddr_union_t localaddr;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(!use_ipv6)
#endif
la_size = sizeof(localaddr.sa4);
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
else
la_size = sizeof(localaddr.sa6);
#endif
case AF_INET:
port = ntohs(localaddr.sa4.sin_port);
break;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
case AF_INET6:
port = ntohs(localaddr.sa6.sin6_port);
break;
for(;;) {
fromlen = sizeof(from);
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(!use_ipv6)
#endif
fromlen = sizeof(from.sa4);
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
else
fromlen = sizeof(from.sa6);
#endif
set_advisor_read_lock(loglockfile);
serverlogslocked = 1;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(!use_ipv6) {
#endif
from.sa4.sin_family = AF_INET;
result = 1;
break;
}
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
}
else {
from.sa6.sin6_family = AF_INET6;
/* In builds without IPv6 support CURLOPT_RESOLVE should skip over those
addresses, so we have to do that as well. */
static const char skip = 0;
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
#define IPV6ONLY(x) x
#else
#define IPV6ONLY(x) &skip
ctx->ai_family = ai->ai_family;
ctx->transport = transport;
ctx->started = Curl_now();
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
if(ctx->ai_family == AF_INET6) {
ctx->stats = ¤t_tr->cf6;
ctx->fail_delay_ms = current_tc->cf6_fail_delay_ms;
{ 2, TURL, "test.com:123:192.0.2.1,192.0.2.2", CURL_IPRESOLVE_WHATEVER,
CNCT_TMOT, 150, 200, 200, 2, 0, 400, TC_TMOT, R_FAIL, NULL },
/* 2 ipv4, fails after ~400ms, reports COULDNT_CONNECT */
-#ifdef ENABLE_IPV6
+#ifdef USE_IPV6
{ 3, TURL, "test.com:123:::1", CURL_IPRESOLVE_WHATEVER,
CNCT_TMOT, 150, 200, 200, 0, 1, 200, TC_TMOT, R_FAIL, NULL },
/* 1 ipv6, fails after ~200ms, reports COULDNT_CONNECT */