The Samba-Bugzilla – Attachment 6457 Details for
Bug 8153
Building on an IPv6-only machine fails to correctly setup getaddrinfo.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am fix for 3.6.0
0001-Fix-bug-8153-found-when-building-on-an-IPv6-only-sys.patch (text/plain), 2.01 KB, created by
Jeremy Allison
on 2011-05-19 19:33:33 UTC
(
hide
)
Description:
git-am fix for 3.6.0
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2011-05-19 19:33:33 UTC
Size:
2.01 KB
patch
obsolete
>From 82e05847c625a8ad48bd8b4f6ce1d8ea305de14f Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Thu, 19 May 2011 12:32:15 -0700 >Subject: [PATCH] Fix bug 8153 found when building on an IPv6-only system by Kai Blin. > >When building on IPv6-only, doing: > >hints.ai_family = AF_INET; >getaddrinfo("0.0.0.0", NULL, &hints, &ppres) > >fails as AF_INET is unavailable on an IPv6-only system. This >causes us to fallback to our replacement getaddrinfo code >which is IPv4-only. > >As we're only trying to detect a specific AIX bug here, >broaden the tests to find that bug, and also test for >working getaddrinfo in an IPv6-only safe way. >--- > lib/replace/libreplace_network.m4 | 19 ++++++++++++++++--- > 1 files changed, 16 insertions(+), 3 deletions(-) > >diff --git a/lib/replace/libreplace_network.m4 b/lib/replace/libreplace_network.m4 >index f9bca40..eadcc6b 100644 >--- a/lib/replace/libreplace_network.m4 >+++ b/lib/replace/libreplace_network.m4 >@@ -240,12 +240,25 @@ if test x"$libreplace_cv_HAVE_GETADDRINFO" = x"yes"; then > { > struct addrinfo hints = {0,}; > struct addrinfo *ppres; >- const char hostname[] = "0.0.0.0"; >+ const char hostname1[] = "0.0.0.0"; >+ const char hostname2[] = "127.0.0.1"; >+ const char hostname3[] = "::"; > hints.ai_socktype = SOCK_STREAM; >- hints.ai_family = AF_INET; >+ hints.ai_family = AF_UNSPEC; > hints.ai_flags = > AI_NUMERICHOST|AI_PASSIVE|AI_ADDRCONFIG; >- return getaddrinfo(hostname, NULL, &hints, &ppres) != 0 ? 1 : 0; >+ /* Test for broken flag combination on AIX. */ >+ if (getaddrinfo(hostname1, NULL, &hints, &ppres) == EAI_BADFLAGS) { >+ /* This fails on an IPv6-only box, but not with >+ the EAI_BADFLAGS error. */ >+ return 1; >+ } >+ if (getaddrinfo(hostname2, NULL, &hints, &ppres) == 0) { >+ /* IPv4 lookup works - good enough. */ >+ return 0; >+ } >+ /* Uh-oh, no IPv4. Are we IPv6-only ? */ >+ return getaddrinfo(hostname3, NULL, &hints, &ppres) != 0 ? 1 : 0; > }], > libreplace_cv_HAVE_GETADDRINFO=yes, > libreplace_cv_HAVE_GETADDRINFO=no) >-- >1.7.3.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
kai
:
review+
Actions:
View
Attachments on
bug 8153
: 6457