diff options
| author | Stig Venaas <venaas@php.net> | 2002-08-17 13:56:39 +0000 |
|---|---|---|
| committer | Stig Venaas <venaas@php.net> | 2002-08-17 13:56:39 +0000 |
| commit | fcc0380588b76f4b7d1d3931b688bfe065a1e0a2 (patch) | |
| tree | 9aea564df0cb805f7fbdeb910584eaded9ea5ea7 | |
| parent | 20693c1ad4c37931cdb403ec700b8b918f51b090 (diff) | |
| download | php-git-fcc0380588b76f4b7d1d3931b688bfe065a1e0a2.tar.gz | |
Added --enable-ipv6 and only look up AAAA in DNS when enabled
| -rw-r--r-- | configure.in | 10 | ||||
| -rw-r--r-- | main/network.c | 4 |
2 files changed, 11 insertions, 3 deletions
diff --git a/configure.in b/configure.in index 129fdfeb2c..da232b0caa 100644 --- a/configure.in +++ b/configure.in @@ -410,9 +410,6 @@ AC_CACHE_CHECK([for IPv6 support], ac_cv_ipv6_support, #include <sys/socket.h> #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;], [ac_cv_ipv6_support=yes], [ac_cv_ipv6_support=no])]) -if test "$ac_cv_ipv6_support" = yes; then - AC_DEFINE(HAVE_IPV6,1,[Whether you have IPv6 support]) -fi @@ -692,6 +689,13 @@ if test "$PHP_DMALLOC" = "yes"; then ]) fi +PHP_ARG_ENABLE(ipv6,whether to enable IPv6 support, +[ --enable-ipv6 Enable IPv6 support],yes) + +if test "$PHP_IPV6" != "no" && test "$ac_cv_ipv6_support" = yes; then + AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support]) +fi + AC_CHECK_LIB(crypt, crypt, [ PHP_ADD_LIBRARY(crypt) PHP_ADD_LIBRARY(crypt, 1) diff --git a/main/network.c b/main/network.c index a4bd9b4e42..3fe7e9a152 100644 --- a/main/network.c +++ b/main/network.c @@ -157,7 +157,11 @@ static int php_network_getaddresses(const char *host, struct sockaddr ***sal) struct addrinfo hints, *res, *sai; memset(&hints, '\0', sizeof(hints)); +# ifdef HAVE_IPV6 hints.ai_family = AF_UNSPEC; +# else + hints.ai_family = AF_INET; +# endif if ((n = getaddrinfo(host, NULL, &hints, &res))) { php_error(E_WARNING, "php_network_getaddresses: getaddrinfo failed: %s", PHP_GAI_STRERROR(n)); return 0; |
