Add back a define of "struct sockaddr_storage" for systems that
authorWayne Davison <wayned@samba.org>
Thu, 8 Nov 2007 01:10:34 +0000 (01:10 +0000)
committerWayne Davison <wayned@samba.org>
Thu, 8 Nov 2007 01:10:34 +0000 (01:10 +0000)
don't have it.

configure.in
lib/addrinfo.h

index 8cdbef1..bffe367 100644 (file)
@@ -436,6 +436,8 @@ AC_CHECK_FUNCS(inet_ntop, , [AC_LIBOBJ(lib/inet_ntop)])
 AC_CHECK_FUNCS(inet_pton, , [AC_LIBOBJ(lib/inet_pton)])
 
 AC_HAVE_TYPE([struct addrinfo], [#include <netdb.h>])
+AC_HAVE_TYPE([struct sockaddr_storage], [#include <sys/types.h>
+#include <sys/socket.h>])
 
 # Irix 6.5 has getaddrinfo but not the corresponding defines, so use
 #   builtin getaddrinfo if one of the defines don't exist
index f3899e5..ee9f672 100644 (file)
@@ -124,7 +124,6 @@ TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 #endif
 
 #ifndef HAVE_STRUCT_ADDRINFO
-
 struct addrinfo
 {
        int                     ai_flags;
@@ -136,8 +135,15 @@ struct addrinfo
        char       *ai_canonname;
        struct addrinfo *ai_next;
 };
-#endif   /* HAVE_STRUCT_ADDRINFO */
+#endif   /* !HAVE_STRUCT_ADDRINFO */
 
+#ifndef HAVE_STRUCT_SOCKADDR_STORAGE
+struct sockaddr_storage {
+       unsigned short ss_family;
+       unsigned long ss_align;
+       char ss_padding[128 - sizeof (unsigned long)];
+};
+#endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */
 
 #ifndef HAVE_GETADDRINFO
 
@@ -169,6 +175,6 @@ extern const char *gai_strerror(int errcode);
 extern int getnameinfo(const struct sockaddr * sa, socklen_t salen,
                        char *node, size_t nodelen,
                        char *service, size_t servicelen, int flags);
-#endif   /* HAVE_GETADDRINFO */
+#endif   /* !HAVE_GETADDRINFO */
 
 #endif   /* ADDRINFO_H */