summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-10-04 17:35:12 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:31:11 -0500
commitb5725f4fecf9ea3dfc999d8c6542dd1ba171f238 (patch)
tree7ddcb108f16081078b6e834c1b6d10f9066d0c47 /source3
parent941544a9514aaae89268bc9d689705ad0724119e (diff)
downloadsamba-b5725f4fecf9ea3dfc999d8c6542dd1ba171f238.tar.gz
samba-b5725f4fecf9ea3dfc999d8c6542dd1ba171f238.tar.bz2
samba-b5725f4fecf9ea3dfc999d8c6542dd1ba171f238.zip
r25507: Fix definition of struct sockaddr_storage if
struct sockaddr_in6 is defined. Jeremy. (This used to be commit 4cf17df5caeb2b0220f6a7dd82d5fed5aca56850)
Diffstat (limited to 'source3')
-rw-r--r--source3/configure.in15
-rw-r--r--source3/lib/replace/system/network.h5
2 files changed, 19 insertions, 1 deletions
diff --git a/source3/configure.in b/source3/configure.in
index dd9d296f64..cd111a0218 100644
--- a/source3/configure.in
+++ b/source3/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/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h
index a09d3bb01b..c2a5dec5af 100644
--- a/source3/lib/replace/system/network.h
+++ b/source3/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