summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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