#ifdef IP_BIND_ADDRESS_NO_PORT
int on = 1;
#endif
+#ifndef ENABLE_IPV6
+ (void)scope;
+#endif
/*************************************************************
* Select device to bind socket to
}
#endif
- switch(Curl_if2ip(af, scope, conn->scope_id, dev,
- myhost, sizeof(myhost))) {
+ switch(Curl_if2ip(af,
+#ifdef ENABLE_IPV6
+ scope, conn->scope_id,
+#endif
+ dev, myhost, sizeof(myhost))) {
case IF2IP_NOT_FOUND:
if(is_interface) {
/* Do not fall back to treating it as a host name */
if(*addr != '\0') {
/* attempt to get the address of the given interface name */
switch(Curl_if2ip(conn->ip_addr->ai_family,
+#ifdef ENABLE_IPV6
Curl_ipv6_scope(conn->ip_addr->ai_addr),
- conn->scope_id, addr, hbuf, sizeof(hbuf))) {
+ conn->scope_id,
+#endif
+ addr, hbuf, sizeof(hbuf))) {
case IF2IP_NOT_FOUND:
/* not an interface, use the given string as host name instead */
host = addr;
#if defined(HAVE_GETIFADDRS)
-if2ip_result_t Curl_if2ip(int af, unsigned int remote_scope,
- unsigned int local_scope_id, const char *interf,
+if2ip_result_t Curl_if2ip(int af,
+#ifdef ENABLE_IPV6
+ unsigned int remote_scope,
+ unsigned int local_scope_id,
+#endif
+ const char *interf,
char *buf, int buf_size)
{
struct ifaddrs *iface, *head;
if2ip_result_t res = IF2IP_NOT_FOUND;
-#ifndef ENABLE_IPV6
- (void) remote_scope;
-#endif
-
-#if !defined(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID) || \
- !defined(ENABLE_IPV6)
+#if defined(ENABLE_IPV6) && \
+ !defined(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID)
(void) local_scope_id;
#endif
#elif defined(HAVE_IOCTL_SIOCGIFADDR)
-if2ip_result_t Curl_if2ip(int af, unsigned int remote_scope,
- unsigned int local_scope_id, const char *interf,
+if2ip_result_t Curl_if2ip(int af,
+#ifdef ENABLE_IPV6
+ unsigned int remote_scope,
+ unsigned int local_scope_id,
+#endif
+ const char *interf,
char *buf, int buf_size)
{
struct ifreq req;
size_t len;
const char *r;
+#ifdef ENABLE_IPV6
(void)remote_scope;
(void)local_scope_id;
+#endif
if(!interf || (af != AF_INET))
return IF2IP_NOT_FOUND;
#else
-if2ip_result_t Curl_if2ip(int af, unsigned int remote_scope,
- unsigned int local_scope_id, const char *interf,
+if2ip_result_t Curl_if2ip(int af,
+#ifdef ENABLE_IPV6
+ unsigned int remote_scope,
+ unsigned int local_scope_id,
+#endif
+ const char *interf,
char *buf, int buf_size)
{
(void) af;
+#ifdef ENABLE_IPV6
(void) remote_scope;
(void) local_scope_id;
+#endif
(void) interf;
(void) buf;
(void) buf_size;
IF2IP_FOUND = 2 /* The address has been stored in "buf" */
} if2ip_result_t;
-if2ip_result_t Curl_if2ip(int af, unsigned int remote_scope,
- unsigned int local_scope_id, const char *interf,
+if2ip_result_t Curl_if2ip(int af,
+#ifdef ENABLE_IPV6
+ unsigned int remote_scope,
+ unsigned int local_scope_id,
+#endif
+ const char *interf,
char *buf, int buf_size);
#ifdef __INTERIX
char *argptr;
CURLcode result = CURLE_OK;
long arg;
+#ifdef ENABLE_IPV6
unsigned long uarg;
+#endif
curl_off_t bigsize;
switch(option) {
break;
#endif
+#ifdef ENABLE_IPV6
case CURLOPT_ADDRESS_SCOPE:
/*
* Use this scope id when using IPv6
#endif
data->set.scope_id = (unsigned int)uarg;
break;
+#endif
case CURLOPT_PROTOCOLS:
/* set the bitmask for the protocols that are allowed to be used for the
return CURLE_OUT_OF_MEMORY;
conn->host.name = conn->host.rawalloc;
+#ifdef ENABLE_IPV6
if(data->set.scope_id)
/* Override any scope that was set above. */
conn->scope_id = data->set.scope_id;
+#endif
return CURLE_OK;
}
cache entry remains locked. It gets unlocked in multi_done() */
struct Curl_addrinfo *ip_addr;
struct Curl_addrinfo *tempaddr[2]; /* for happy eyeballs */
-
+#ifdef ENABLE_IPV6
unsigned int scope_id; /* Scope id for IPv6 */
+#endif
enum {
TRNSPRT_TCP = 3,
long ssh_auth_types; /* allowed SSH auth types */
char *str[STRING_LAST]; /* array of strings, pointing to allocated memory */
struct curl_blob *blobs[BLOB_LAST];
+#ifdef ENABLE_IPV6
unsigned int scope_id; /* Scope id for IPv6 */
+#endif
long allowed_protocols;
long redir_protocols;
long mime_options; /* Mime option flags. */