summaryrefslogtreecommitdiff
path: root/ext/standard/dns.c
diff options
context:
space:
mode:
authorMarko Karppinen <markonen@php.net>2003-10-24 17:09:36 +0000
committerMarko Karppinen <markonen@php.net>2003-10-24 17:09:36 +0000
commit074ca4539964d736f3a31a4fb10f4eabd77addfa (patch)
tree6012a69e1663a3dbe471e22f4ec0a84db2cec936 /ext/standard/dns.c
parent663b12796b9b977226f11a8940efd53a9863e161 (diff)
downloadphp-git-074ca4539964d736f3a31a4fb10f4eabd77addfa.tar.gz
Workaround for bug #25955
Generalized a Darwin check in dns.c to a check for inet_pton() (kalowsky)
Diffstat (limited to 'ext/standard/dns.c')
-rw-r--r--ext/standard/dns.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/ext/standard/dns.c b/ext/standard/dns.c
index eddb67ed43..64b563096a 100644
--- a/ext/standard/dns.c
+++ b/ext/standard/dns.c
@@ -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)) {