Updates:
        Cc: [email protected]

Comment #13 on issue 12711 by [email protected]: Unable to resolve and view  
site that using IPv6
http://code.google.com/p/chromium/issues/detail?id=12711

We should add a LOG(ERROR) statement to log the return value of
getaddrinfo when it fails.  Then we can remove the AI_ADDRCONFIG
flag.

Here is the change in which Darin removed AI_ADDRCONFIG from NSPR
(a library used by Firefox).

mozilla/nsprpub/pr/src/misc/prnetdb.c, rev. 3.21.2.13.10.4 on the
NSPR_GETADDRINFO_BRANCH:

----------------------------
revision 3.21.2.13.10.4
date: 2003/08/13 23:55:21;  author: darin%meer.net;  state: Exp;  lines: +6  
-7
remove |#ifdef AI_ADDRCONFIG| block since AI_ADDRCONFIG may be defined
for use with getipnodebyname, but have no meaning when used with
getaddrinfo.  (patch suggested by wtc)
----------------------------

I don't remember why I suggested that patch.  The patch is:

w...@aes:/usr/local/google/home/wtc/nss-tip/mozilla/nsprpub/pr/src/misc$ cvs  
-q diff
-pu8 -r3.21.2.13.10.3 -r3.21.2.13.10.4 prnetdb.c
Index: prnetdb.c
===================================================================
RCS file: /cvsroot/mozilla/nsprpub/pr/src/misc/prnetdb.c,v
retrieving revision 3.21.2.13.10.3
retrieving revision 3.21.2.13.10.4
diff -u -p -u -8 -r3.21.2.13.10.3 -r3.21.2.13.10.4
--- prnetdb.c   30 Jul 2003 17:34:08 -0000      3.21.2.13.10.3
+++ prnetdb.c   13 Aug 2003 23:55:21 -0000      3.21.2.13.10.4
@@ -2070,27 +2070,26 @@ PR_IMPLEMENT(PRAddrInfo *) PR_GetAddrInf
      if (!_pr_ipv6_is_present) {
          return pr_GetAddrInfoByNameFB(hostname, af, flags);
      }
  #endif
      {
          PRADDRINFO *res, hints;
          PRStatus rv;

+        /*
+         * we assume a RFC 2553 compliant getaddrinfo.  this may at some
+         * point need to be customized as platforms begin to adopt the
+         * RFC 3493.
+         */
+
          memset(&hints, 0, sizeof(hints));
          hints.ai_flags = AI_CANONNAME;
          hints.ai_family = AF_UNSPEC;

-#ifdef AI_ADDRCONFIG
-        /* By default, only look up addresses using address types for
-         * which a local interface is configured (i.e. no IPv6 if no IPv6
-         * interfaces. NOTE: do this only if ai_family is PF_UNSPEC. */
-        hints.ai_flags |= AI_ADDRCONFIG;
-#endif
-
          rv = GETADDRINFO(hostname, NULL, &hints, &res);
          if (rv == 0)
              return (PRAddrInfo *) res;

          PR_SetError(PR_DIRECTORY_LOOKUP_ERROR, rv);
      }
      return NULL;
  #endif

Since then, the only change to that code is:

-    if (!_pr_ipv6_is_present) {
+    if (!_pr_ipv6_is_present()) {
          return pr_GetAddrInfoByNameFB(hostname, af, flags);
      }
  #endif
      {
          PRADDRINFO *res, hints;
          PRStatus rv;

          /*
           * we assume a RFC 2553 compliant getaddrinfo.  this may at some
           * point need to be customized as platforms begin to adopt the
           * RFC 3493.
           */

          memset(&hints, 0, sizeof(hints));
-        hints.ai_flags = AI_CANONNAME;
-        hints.ai_family = AF_UNSPEC;
+        hints.ai_flags = (flags & PR_AI_NOCANONNAME) ? 0: AI_CANONNAME;
+        hints.ai_family = (af == PR_AF_INET) ? AF_INET : AF_UNSPEC;
+
+        /*
+         * it is important to select a socket type in the hints, otherwise  
we
+         * will get back repetitive entries: one for each socket type.   
since
+         * we do not expose ai_socktype through our API, it is okay to do  
this
+         * here.  the application may still choose to create a socket of  
some
+         * other type.
+         */
+        hints.ai_socktype = SOCK_STREAM;

          rv = GETADDRINFO(hostname, NULL, &hints, &res);
          if (rv == 0)
              return (PRAddrInfo *) res;

          PR_SetError(PR_DIRECTORY_LOOKUP_ERROR, rv);
      }
      return NULL;
  #endif

Firefox passes af=PR_AF_UNSPEC to this function by default, except
for the "IPv4-only domains" or when IPv6 is disabled (see the
nsDNSService::GetAFForLookup function in netwerk/dns/src/nsDNSService2.cpp).

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/group/chromium-bugs
-~----------~----~----~----~------~----~------~--~---

Reply via email to