aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGunter Knauf <gk@gknw.de>2008-12-30 08:05:38 +0000
committerGunter Knauf <gk@gknw.de>2008-12-30 08:05:38 +0000
commit1cc50d31f9962264fd78cdbe6a27dac10742dcd6 (patch)
tree29f86554facab9f8dfecbd59548161a7603bf9df /lib
parent104377d718654947f42f8812b17d1d3127c843a0 (diff)
changed HAVE_SIN6_SCOPE_ID define to HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID since just found that ares already uses this define.
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile.netware2
-rw-r--r--lib/config-os400.h2
-rw-r--r--lib/config-riscos.h2
-rw-r--r--lib/config-symbian.h2
-rw-r--r--lib/config-tpf.h2
-rw-r--r--lib/config-win32ce.h2
-rw-r--r--lib/connect.c2
-rw-r--r--lib/if2ip.c4
8 files changed, 10 insertions, 8 deletions
diff --git a/lib/Makefile.netware b/lib/Makefile.netware
index 546086796..658b97996 100644
--- a/lib/Makefile.netware
+++ b/lib/Makefile.netware
@@ -454,7 +454,7 @@ ifdef ENABLE_IPV6
@echo $(DL)#define ENABLE_IPV6 1$(DL) >> $@
@echo $(DL)#define HAVE_FREEADDRINFO 1$(DL) >> $@
@echo $(DL)#define HAVE_GETADDRINFO 1$(DL) >> $@
- @echo $(DL)#define HAVE_SIN6_SCOPE_ID 1$(DL) >> $@
+ @echo $(DL)#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1$(DL) >> $@
endif
endif
@echo $(DL)#define USE_MANUAL 1$(DL) >> $@
diff --git a/lib/config-os400.h b/lib/config-os400.h
index dccf8a869..efb019551 100644
--- a/lib/config-os400.h
+++ b/lib/config-os400.h
@@ -43,7 +43,7 @@
#define ENABLE_IPV6
/* Define if struct sockaddr_in6 has the sin6_scope_id member */
-#define HAVE_SIN6_SCOPE_ID 1
+#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
/* Define this to 'int' if ssize_t is not an available typedefed type */
#undef ssize_t
diff --git a/lib/config-riscos.h b/lib/config-riscos.h
index 25097fb0b..e525c6a60 100644
--- a/lib/config-riscos.h
+++ b/lib/config-riscos.h
@@ -39,7 +39,7 @@
#undef ENABLE_IPV6
/* Define if struct sockaddr_in6 has the sin6_scope_id member */
-#define HAVE_SIN6_SCOPE_ID 1
+#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
/* Define this to 'int' if ssize_t is not an available typedefed type */
#undef ssize_t
diff --git a/lib/config-symbian.h b/lib/config-symbian.h
index cc9b03cb9..5f8296add 100644
--- a/lib/config-symbian.h
+++ b/lib/config-symbian.h
@@ -67,7 +67,7 @@
#define ENABLE_IPV6 1
/* Define if struct sockaddr_in6 has the sin6_scope_id member */
-#define HAVE_SIN6_SCOPE_ID 1
+#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
/* Define to the type qualifier of arg 1 for getnameinfo. */
#define GETNAMEINFO_QUAL_ARG1 const
diff --git a/lib/config-tpf.h b/lib/config-tpf.h
index 8524cda19..107158ca8 100644
--- a/lib/config-tpf.h
+++ b/lib/config-tpf.h
@@ -63,7 +63,7 @@
/* #undef ENABLE_IPV6 */
/* Define if struct sockaddr_in6 has the sin6_scope_id member */
-/* #undef HAVE_SIN6_SCOPE_ID */
+/* #undef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID */
/* Define to the type of arg 1 for getnameinfo. */
/* #undef GETNAMEINFO_TYPE_ARG1 */
diff --git a/lib/config-win32ce.h b/lib/config-win32ce.h
index 65b00a104..69caa4666 100644
--- a/lib/config-win32ce.h
+++ b/lib/config-win32ce.h
@@ -324,7 +324,7 @@
#define HAVE_STRUCT_TIMEVAL 1
/* Define this if struct sockaddr_in6 has the sin6_scope_id member */
-#define HAVE_SIN6_SCOPE_ID 1
+#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
/* ---------------------------------------------------------------- */
/* COMPILER SPECIFIC */
diff --git a/lib/connect.c b/lib/connect.c
index 569142d3e..47e8681c5 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -769,7 +769,7 @@ singleipconnect(struct connectdata *conn,
/* no socket, no connection */
return CURL_SOCKET_BAD;
-#ifdef ENABLE_IPV6
+#if defined(ENABLE_IPV6) && defined(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID)
if (conn->scope && (addr.family == AF_INET6))
sa6->sin6_scope_id = conn->scope;
#endif
diff --git a/lib/if2ip.c b/lib/if2ip.c
index 74cd5266e..0e74042d2 100644
--- a/lib/if2ip.c
+++ b/lib/if2ip.c
@@ -86,10 +86,12 @@ char *Curl_if2ip(int af, const char *interface, char *buf, int buf_size)
char scope[12]="";
#ifdef ENABLE_IPV6
if (af == AF_INET6) {
- unsigned int scopeid;
+ unsigned int scopeid = 0;
addr = &((struct sockaddr_in6 *)iface->ifa_addr)->sin6_addr;
+#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
/* Include the scope of this interface as part of the address */
scopeid = ((struct sockaddr_in6 *)iface->ifa_addr)->sin6_scope_id;
+#endif
if (scopeid)
snprintf(scope, sizeof(scope), "%%%u", scopeid);
}