diff options
author | Volker Lendecke <vl@samba.org> | 2010-02-07 18:09:11 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2010-02-08 09:59:20 +0100 |
commit | 6e7bcaa878af80be338b18bfe4ec45c51ebbeeed (patch) | |
tree | 6b01cd450d5f29fa35ec939892346a1b0034c1b9 /lib | |
parent | 9fed9011ffcd76c5a5dbf16f7d5e657b94f9fa50 (diff) | |
download | samba-6e7bcaa878af80be338b18bfe4ec45c51ebbeeed.tar.gz samba-6e7bcaa878af80be338b18bfe4ec45c51ebbeeed.tar.xz samba-6e7bcaa878af80be338b18bfe4ec45c51ebbeeed.zip |
libreplace: Attempt to fix bug 5910, detect a broken getaddrinfo
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/replace/libreplace_network.m4 | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/replace/libreplace_network.m4 b/lib/replace/libreplace_network.m4 index b7d15eaddb..bccd77336a 100644 --- a/lib/replace/libreplace_network.m4 +++ b/lib/replace/libreplace_network.m4 @@ -226,6 +226,31 @@ ret = getnameinfo(&sa, sizeof(sa), ], libreplace_cv_HAVE_GETADDRINFO=yes,libreplace_cv_HAVE_GETADDRINFO=no)]) + +if test x"$libreplace_cv_HAVE_GETADDRINFO" = x"yes"; then + # getaddrinfo is broken on some AIX systems + # see bug 5910, use our replacements if we detect + # a broken system. + AC_TRY_RUN([ + #include <stddef.h> + #include <sys/types.h> + #include <sys/socket.h> + #include <netdb.h> + int main(int argc, const char *argv[]) + { + struct addrinfo hints = {0,}; + struct addrinfo *ppres; + const char hostname[] = "0.0.0.0"; + hints.ai_socktype = SOCK_STREAM; + hints.ai_family = AF_INET; + hints.ai_flags = + AI_NUMERICHOST|AI_PASSIVE|AI_ADDRCONFIG; + return getaddrinfo(hostname, NULL, &hints, &ppres) != 0 ? 1 : 0; + }], + libreplace_cv_HAVE_GETADDRINFO=yes, + libreplace_cv_HAVE_GETADDRINFO=no) +fi + if test x"$libreplace_cv_HAVE_GETADDRINFO" = x"yes"; then AC_DEFINE(HAVE_GETADDRINFO,1,[Whether the system has getaddrinfo]) AC_DEFINE(HAVE_GETNAMEINFO,1,[Whether the system has getnameinfo]) |