]> granicus.if.org Git - php/commitdiff
Workaround for bug #25955
authorMarko Karppinen <markonen@php.net>
Fri, 24 Oct 2003 17:09:36 +0000 (17:09 +0000)
committerMarko Karppinen <markonen@php.net>
Fri, 24 Oct 2003 17:09:36 +0000 (17:09 +0000)
Generalized a Darwin check in dns.c to a check for inet_pton() (kalowsky)

configure.in
ext/standard/dns.c

index cd3aeeebd5836554ded842f8bfe23ea83f667191..425334169e65507a48eba107633168b6a0c49a7b 100644 (file)
@@ -189,6 +189,7 @@ case $host_alias in
     CPPFLAGS="$CPPFLAGS -D_BSD_TIMEOFDAY_FLAVOR";;
 *darwin*|*rhapsody*)
     CPPFLAGS="$CPPFLAGS -no-cpp-precomp"
+    AC_DEFINE(BIND_8_COMPAT, 1, [Enabling BIND8 compatibility for Panther])
     php_multiple_shlib_versions_ok=yes;;
 *beos*)
     beos_threads=1
@@ -480,6 +481,7 @@ gettimeofday \
 gmtime_r \
 inet_ntoa \
 inet_ntop \
+inet_pton \
 isascii \
 link \
 localtime_r \
index eddb67ed435f11eca710dd6b36f761a47edce075..64b563096a4b51cef60952ea34ca422af0f217e7 100644 (file)
@@ -90,9 +90,7 @@ PHP_FUNCTION(gethostbyaddr)
        addr = php_gethostbyaddr(Z_STRVAL_PP(arg));
 
        if(addr == NULL) {
-#if HAVE_IPV6 && !defined(__MacOSX__)
-/* MacOSX at this time has support for IPv6, but not inet_pton()
- * so disabling IPv6 until further notice.  MacOSX 10.1.2 (kalowsky) */
+#if HAVE_IPV6 && HAVE_INET_PTON
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Address is not a valid IPv4 or IPv6 address");
 #else
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Address is not in a.b.c.d form");
@@ -107,17 +105,13 @@ PHP_FUNCTION(gethostbyaddr)
 /* {{{ php_gethostbyaddr */
 static char *php_gethostbyaddr(char *ip)
 {
-#if HAVE_IPV6 && !defined(__MacOSX__)
-/* MacOSX at this time has support for IPv6, but not inet_pton()
- * so disabling IPv6 until further notice.  MacOSX 10.1.2 (kalowsky) */
+#if HAVE_IPV6 && HAVE_INET_PTON
        struct in6_addr addr6;
 #endif
        struct in_addr addr;
        struct hostent *hp;
 
-#if HAVE_IPV6 && !defined(__MacOSX__)
-/* MacOSX at this time has support for IPv6, but not inet_pton()
- * so disabling IPv6 until further notice.  MacOSX 10.1.2 (kalowsky) */
+#if HAVE_IPV6 && HAVE_INET_PTON
        if (inet_pton(AF_INET6, ip, &addr6)) {
                hp = gethostbyaddr((char *) &addr6, sizeof(addr6), AF_INET6);
        } else if (inet_pton(AF_INET, ip, &addr)) {