Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(807)

Unified Diff: net/base/host_resolver_proc.cc

Issue 172061: Don't use the AI_ADDRCONFIG flag on Mac OS X. It's not necessary.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/host_resolver_proc.cc
===================================================================
--- net/base/host_resolver_proc.cc (revision 23576)
+++ net/base/host_resolver_proc.cc (working copy)
@@ -157,6 +157,23 @@
// 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698