summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-17 23:01:33 +0000
committerwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-17 23:01:33 +0000
commitd9810a805d4e4626bf2ec9dc805e5643a801d3d9 (patch)
tree5f16ca9364f2c276a62ef358914fa22bca37f989 /net
parent2fab253a61e797b461b21671af7942521b749ee3 (diff)
downloadchromium_src-d9810a805d4e4626bf2ec9dc805e5643a801d3d9.zip
chromium_src-d9810a805d4e4626bf2ec9dc805e5643a801d3d9.tar.gz
chromium_src-d9810a805d4e4626bf2ec9dc805e5643a801d3d9.tar.bz2
Don't use the AI_ADDRCONFIG flag on Mac OS X. It's not necessary.
Hopefully this will fix issue 12711. R=eroman,mark BUG=http://crbug.com/12711 TEST=covered by existing unit tests and normal browsing on Mac Review URL: http://codereview.chromium.org/172061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23590 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/host_resolver_proc.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/net/base/host_resolver_proc.cc b/net/base/host_resolver_proc.cc
index 8951646..6c9400d 100644
--- a/net/base/host_resolver_proc.cc
+++ b/net/base/host_resolver_proc.cc
@@ -157,6 +157,23 @@ int SystemHostResolverProc(const std::string& host, AddressList* addrlist) {
// address.
// See http://crbug.com/5234.
hints.ai_flags = 0;
+#elif defined(OS_MACOSX)
+ // We don't need to use AI_ADDRCONFIG on Mac OS X. There are two evidences:
+ //
+ // 1. The getaddrinfo man page on Mac OS X documents only three flags:
+ // AI_CANONNAME, AI_NUMERICHOST, and AI_PASSIVE, and shows an example that
+ // sets hints.ai_flags to 0.
+ // 2. The <netdb.h> header lists only those three flags in the comment after
+ // the ai_flags field of struct addrinfo, and defines an AI_MASK macro as
+ // the bitwise-OR of those three flags with the comment "valid flags for
+ // addrinfo".
+ //
+ // But is it harmful to use AI_ADDRCONFIG? Unfortunately I can't find a
+ // definitive answer by browsing the getaddrinfo source code in Darwin (in
+ // the Libinfo project).
+ //
+ // See http://crbug.com/12711.
+ hints.ai_flags = 0;
#else
hints.ai_flags = AI_ADDRCONFIG;
#endif