changed HAVE_SIN6_SCOPE_ID define to HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID since just found that ares already uses this define.

This commit is contained in:
Gunter Knauf 2008-12-30 08:05:38 +00:00
parent 104377d718
commit 1cc50d31f9
12 changed files with 16 additions and 14 deletions

View File

@ -826,10 +826,10 @@ if test "$ipv6" = yes; then
#include <netinet/in.h>] , #include <netinet/in.h>] ,
struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes) struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes)
if test "$have_sin6_scope_id" = yes; then if test "$have_sin6_scope_id" = yes; then
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member]) AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member])
else else
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
fi fi
fi fi

View File

@ -454,7 +454,7 @@ ifdef ENABLE_IPV6
@echo $(DL)#define ENABLE_IPV6 1$(DL) >> $@ @echo $(DL)#define ENABLE_IPV6 1$(DL) >> $@
@echo $(DL)#define HAVE_FREEADDRINFO 1$(DL) >> $@ @echo $(DL)#define HAVE_FREEADDRINFO 1$(DL) >> $@
@echo $(DL)#define HAVE_GETADDRINFO 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
endif endif
@echo $(DL)#define USE_MANUAL 1$(DL) >> $@ @echo $(DL)#define USE_MANUAL 1$(DL) >> $@

View File

@ -43,7 +43,7 @@
#define ENABLE_IPV6 #define ENABLE_IPV6
/* Define if struct sockaddr_in6 has the sin6_scope_id member */ /* 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 */ /* Define this to 'int' if ssize_t is not an available typedefed type */
#undef ssize_t #undef ssize_t

View File

@ -39,7 +39,7 @@
#undef ENABLE_IPV6 #undef ENABLE_IPV6
/* Define if struct sockaddr_in6 has the sin6_scope_id member */ /* 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 */ /* Define this to 'int' if ssize_t is not an available typedefed type */
#undef ssize_t #undef ssize_t

View File

@ -67,7 +67,7 @@
#define ENABLE_IPV6 1 #define ENABLE_IPV6 1
/* Define if struct sockaddr_in6 has the sin6_scope_id member */ /* 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 to the type qualifier of arg 1 for getnameinfo. */
#define GETNAMEINFO_QUAL_ARG1 const #define GETNAMEINFO_QUAL_ARG1 const

View File

@ -63,7 +63,7 @@
/* #undef ENABLE_IPV6 */ /* #undef ENABLE_IPV6 */
/* Define if struct sockaddr_in6 has the sin6_scope_id member */ /* 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. */ /* Define to the type of arg 1 for getnameinfo. */
/* #undef GETNAMEINFO_TYPE_ARG1 */ /* #undef GETNAMEINFO_TYPE_ARG1 */

View File

@ -324,7 +324,7 @@
#define HAVE_STRUCT_TIMEVAL 1 #define HAVE_STRUCT_TIMEVAL 1
/* Define this if struct sockaddr_in6 has the sin6_scope_id member */ /* 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 */ /* COMPILER SPECIFIC */

View File

@ -769,7 +769,7 @@ singleipconnect(struct connectdata *conn,
/* no socket, no connection */ /* no socket, no connection */
return CURL_SOCKET_BAD; 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)) if (conn->scope && (addr.family == AF_INET6))
sa6->sin6_scope_id = conn->scope; sa6->sin6_scope_id = conn->scope;
#endif #endif

View File

@ -86,10 +86,12 @@ char *Curl_if2ip(int af, const char *interface, char *buf, int buf_size)
char scope[12]=""; char scope[12]="";
#ifdef ENABLE_IPV6 #ifdef ENABLE_IPV6
if (af == AF_INET6) { if (af == AF_INET6) {
unsigned int scopeid; unsigned int scopeid = 0;
addr = &((struct sockaddr_in6 *)iface->ifa_addr)->sin6_addr; 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 */ /* Include the scope of this interface as part of the address */
scopeid = ((struct sockaddr_in6 *)iface->ifa_addr)->sin6_scope_id; scopeid = ((struct sockaddr_in6 *)iface->ifa_addr)->sin6_scope_id;
#endif
if (scopeid) if (scopeid)
snprintf(scope, sizeof(scope), "%%%u", scopeid); snprintf(scope, sizeof(scope), "%%%u", scopeid);
} }

View File

@ -442,7 +442,7 @@ ifdef ENABLE_IPV6
@echo $(DL)#define ENABLE_IPV6 1$(DL) >> $@ @echo $(DL)#define ENABLE_IPV6 1$(DL) >> $@
@echo $(DL)#define HAVE_FREEADDRINFO 1$(DL) >> $@ @echo $(DL)#define HAVE_FREEADDRINFO 1$(DL) >> $@
@echo $(DL)#define HAVE_GETADDRINFO 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
endif endif
@echo $(DL)#define USE_MANUAL 1$(DL) >> $@ @echo $(DL)#define USE_MANUAL 1$(DL) >> $@

View File

@ -42,7 +42,7 @@
#undef ENABLE_IPV6 #undef ENABLE_IPV6
/* Define if struct sockaddr_in6 has the sin6_scope_id member */ /* 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 */ /* Define this to 'int' if ssize_t is not an available typedefed type */
#undef ssize_t #undef ssize_t

View File

@ -201,7 +201,7 @@
#define HAVE_STRUCT_TIMEVAL 1 #define HAVE_STRUCT_TIMEVAL 1
/* Define this if struct sockaddr_in6 has the sin6_scope_id member */ /* 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
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */
/* Watt-32 tcp/ip SPECIFIC */ /* Watt-32 tcp/ip SPECIFIC */