diff options
author | Jeremy Allison <jra@samba.org> | 2007-10-04 17:35:12 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:31:11 -0500 |
commit | 4cf17df5caeb2b0220f6a7dd82d5fed5aca56850 (patch) | |
tree | 341e4ec864d80f2498a9ebe991d84cf6fcbb3777 | |
parent | 760d993340a966269d71acfb7a6b5e4d3776ac5d (diff) | |
download | samba-4cf17df5caeb2b0220f6a7dd82d5fed5aca56850.tar.gz samba-4cf17df5caeb2b0220f6a7dd82d5fed5aca56850.tar.xz samba-4cf17df5caeb2b0220f6a7dd82d5fed5aca56850.zip |
r25507: Fix definition of struct sockaddr_storage if
struct sockaddr_in6 is defined.
Jeremy.
-rw-r--r-- | source/configure.in | 15 | ||||
-rw-r--r-- | source/lib/replace/system/network.h | 5 |
2 files changed, 19 insertions, 1 deletions
diff --git a/source/configure.in b/source/configure.in index dd9d296f640..cd111a02184 100644 --- a/source/configure.in +++ b/source/configure.in @@ -3195,7 +3195,7 @@ if test x"$samba_cv_HAVE_IPV6" = x"yes"; then fi dnl test for struct sockaddr_storage -AC_CACHE_CHECK([for ipv6 support],samba_cv_HAVE_STRUCT_SOCKADDR_STORAGE,[ +AC_CACHE_CHECK([for struct sockaddr_storage],samba_cv_HAVE_STRUCT_SOCKADDR_STORAGE,[ AC_TRY_COMPILE([ #include <sys/socket.h> #include <sys/types.h>], @@ -3207,6 +3207,19 @@ if test x"$samba_cv_HAVE_STRUCT_SOCKADDR_STORAGE" = x"yes"; then AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE,1,[Whether the system has struct sockaddr_storage]) fi +dnl test for struct struct sockaddr_in6 +AC_CACHE_CHECK([for struct sockaddr_in6],samba_cv_HAVE_STRUCT_SOCKADDR_IN6,[ +AC_TRY_COMPILE([ +#include <sys/socket.h> +#include <sys/types.h>], +[ +struct sockaddr_in6 sa6; +], +samba_cv_HAVE_STRUCT_SOCKADDR_IN6=yes,samba_cv_HAVE_STRUCT_SOCKADDR_IN6=no)]) +if test x"$samba_cv_HAVE_STRUCT_SOCKADDR_IN6" = x"yes"; then + AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6,1,[Whether the system has struct sockaddr_in6]) +fi + dnl test for struct addrinfo AC_CACHE_CHECK([for struct addrinfo],samba_cv_HAVE_STRUCT_ADDRINFO,[ AC_TRY_COMPILE([ diff --git a/source/lib/replace/system/network.h b/source/lib/replace/system/network.h index a09d3bb01b7..c2a5dec5af8 100644 --- a/source/lib/replace/system/network.h +++ b/source/lib/replace/system/network.h @@ -127,9 +127,14 @@ typedef unsigned short int sa_family_t; #endif #ifndef HAVE_STRUCT_SOCKADDR_STORAGE +#ifdef HAVE_STRUCT_SOCKADDR_IN6 +#define sockaddr_storage sockaddr_in6 +#define ss_family sin6_family +#else #define sockaddr_storage sockaddr_in #define ss_family sin_family #endif +#endif #ifndef HOST_NAME_MAX #define HOST_NAME_MAX 256 |