diff options
author | darin%meer.net <devnull@localhost> | 2003-11-27 01:30:44 +0000 |
---|---|---|
committer | darin%meer.net <devnull@localhost> | 2003-11-27 01:30:44 +0000 |
commit | c957522a6ab4a508c433017e1046b348c7bb56d8 (patch) | |
tree | 61f42739141162d27a6d4f52daa884444d0d6965 | |
parent | a58f9d655e9218246dce60269fbf38a3510ce800 (diff) | |
download | nspr-hg-MOZILLA_1_6b_RELEASE.tar.gz |
fixes bug 222031 "OSX getaddrinfo returns concatenated results from /etc/hosts and DNS, which breaks /etc/hosts based ad blocking" r=wtc a=dbaronTHUNDERBIRD_0_4_BASEMOZILLA_1_6b_RELEASE
-rw-r--r-- | pr/include/md/_darwin.h | 7 | ||||
-rw-r--r-- | pr/src/pthreads/ptio.c | 15 |
2 files changed, 20 insertions, 2 deletions
diff --git a/pr/include/md/_darwin.h b/pr/include/md/_darwin.h index d8487441..38b9ead7 100644 --- a/pr/include/md/_darwin.h +++ b/pr/include/md/_darwin.h @@ -74,8 +74,11 @@ * if you pass an IPv4-mapped IPv6 address to it. */ #define _PR_GHBA_DISALLOW_V4MAPPED -/* socket(AF_INET6) fails with EPROTONOSUPPORT on Mac OS X 10.1. */ -#if MACOS_DEPLOYMENT_TARGET < 100200 +/* + * socket(AF_INET6) fails with EPROTONOSUPPORT on Mac OS X 10.1. + * IPv6 under OS X 10.2 and below is not complete (see bug 222031). + */ +#if MACOS_DEPLOYMENT_TARGET < 100300 #define _PR_INET6_PROBE #endif /* Mac OS X 10.2 has inet_ntop and inet_pton. */ diff --git a/pr/src/pthreads/ptio.c b/pr/src/pthreads/ptio.c index 6222b722..130004b0 100644 --- a/pr/src/pthreads/ptio.c +++ b/pr/src/pthreads/ptio.c @@ -57,6 +57,9 @@ #include <sys/uio.h> #include <sys/file.h> #include <sys/ioctl.h> +#if defined(DARWIN) +#include <sys/utsname.h> /* for uname */ +#endif #if defined(SOLARIS) || defined(UNIXWARE) #include <sys/filio.h> /* to pick up FIONREAD */ #endif @@ -3402,6 +3405,18 @@ PR_IMPLEMENT(PRBool) _pr_test_ipv6_socket() { PRInt32 osfd; +#if defined(DARWIN) + /* + * Disable IPv6 if Darwin version is less than 7.0.0 (OS X 10.3). IPv6 on + * lesser versions is not ready for general use (see bug 222031). + */ + { + struct utsname u; + if (uname(&u) != 0 || atoi(u.release) < 7) + return PR_FALSE; + } +#endif + /* * HP-UX only: HP-UX IPv6 Porting Guide (dated February 2001) * suggests that we call open("/dev/ip6", O_RDWR) to determine |