Tue nov  9 19:29:04 CET 2004 Dodji Seketeli <dodji@seketeli.org>

        * configure.in: detect when struct sockaddr_storage
        has the __ss_family member instead of ss_family and
        behave accordingly. We know can use ipv6 on aix.
diff --git a/ChangeLog b/ChangeLog
index 2d8c02e..5651796 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue nov  9 19:24:31 CET 2004 Dodji Seketeli <dodji@seketeli.org>
+
+	* configure.in: detect when struct sockaddr_storage
+	has the __ss_family member instead of ss_family and
+	behave accordingly. We know can use ipv6 on aix.
+
 Tue Nov  9 17:15:46 CET 2004 Daniel Veillard <daniel@veillard.com>
 
 	* Makefile.am gentest.py testapi.c: integrated in "make tests"
diff --git a/configure.in b/configure.in
index 53b8a24..cab221d 100644
--- a/configure.in
+++ b/configure.in
@@ -243,6 +243,28 @@
 
   if test $have_ipv6 = yes; then
     AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
+    have_broken_ss_family=no
+
+    dnl *********************************************************************
+    dnl on some platforms (like AIX 5L), the structure sockaddr doesn't have
+    dnl a ss_family member, but rather __ss_family. Let's detect that
+    dnl and define the HAVE_BROKEN_SS_FAMILY when we are on one of these platforms.
+    dnl ********************************************************************
+    AC_MSG_CHECKING([broken struct sockaddr::ss_family])
+    AC_TRY_COMPILE([
+      #include <sys/socket.h>
+      #include <sys/types.h>], [
+      struct sockaddr_storage ss ;
+      ss.__ss_family = 0 ;
+      ],
+      have_broken_ss_family=yes,
+      have_broken_ss_family=no
+    )
+    AC_MSG_RESULT($have_broken_ss_family)
+    if test x$have_broken_ss_family = xyes ; then
+      AC_DEFINE(HAVE_BROKEN_SS_FAMILY, [], [Whether struct sockaddr::__ss_family exists]) 
+      AC_DEFINE(ss_family, __ss_family, [ss_family is not defined here, use __ss_family instead])
+    fi
 
     have_getaddrinfo=no
     AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)