cvs: php4 / configure.in /main network.c
| From: | Stig Venaas | Date: | Thu, 19 Oct 2000 12:18:02 +0000 |
| Subject: | cvs: php4 / configure.in /main network.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-2128@lists.php.net to get a copy of this message | ||
venaas Thu Oct 19 05:18:02 2000 EDT
Modified files:
/php4 configure.in
/php4/main network.c
Log:
Check that AF_INET6 is defined before using IPv6
Index: php4/configure.in
diff -u php4/configure.in:1.188 php4/configure.in:1.189
--- php4/configure.in:1.188 Fri Oct 13 02:29:49 2000
+++ php4/configure.in Thu Oct 19 05:18:02 2000
@@ -1,4 +1,4 @@
-dnl ## $Id: configure.in,v 1.188 2000/10/13 09:29:49 dbeu Exp $ -*- sh -*-
+dnl ## $Id: configure.in,v 1.189 2000/10/19 12:18:02 venaas Exp $ -*- sh -*-
dnl ## Process this file with autoconf to produce a configure script.
divert(1)
@@ -333,13 +333,13 @@
AC_TYPE_SIZE_T
AC_TYPE_UID_T
-dnl Check for struct sockaddr_in6
-AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_struct_sockaddr_in6,
+dnl Check for IPv6 support
+AC_CACHE_CHECK([for IPv6 support], ac_cv_ipv6_support,
[AC_TRY_COMPILE([#include <sys/socket.h>
-#include <netinet/in.h>], [struct sockaddr_in6 s; s;],
- ac_cv_struct_sockaddr_in6=yes, ac_cv_struct_sockaddr_in6=no)])
-if test "$ac_cv_struct_sockaddr_in6" = yes; then
- AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6,1,[Whether you have struct sockaddr_in6])
+#include <netinet/in.h>], [struct sockaddr_in6 s; int i=AF_INET6; s],
+ 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
dnl Checks for library functions.
Index: php4/main/network.c
diff -u php4/main/network.c:1.9 php4/main/network.c:1.10
--- php4/main/network.c:1.9 Mon Sep 18 08:15:27 2000
+++ php4/main/network.c Thu Oct 19 05:18:02 2000
@@ -15,7 +15,7 @@
| Authors: Stig Venaas <venaas@uninett.no> |
+----------------------------------------------------------------------+
*/
-/* $Id: network.c,v 1.9 2000/09/18 15:15:27 stas Exp $ */
+/* $Id: network.c,v 1.10 2000/10/19 12:18:02 venaas Exp $ */
#include "php.h"
@@ -93,7 +93,7 @@
sap = *sal;
do {
switch (sai->ai_family) {
-# ifdef HAVE_STRUCT_SOCKADDR_IN6
+# ifdef HAVE_IPV6
case AF_INET6: {
*sap = emalloc(sizeof(struct sockaddr_in6));
if (*sap == NULL) {
@@ -170,7 +170,7 @@
s = socket((*sal)->sa_family, socktype, 0);
if (s != SOCK_ERR) {
switch ((*sal)->sa_family) {
-#if defined( HAVE_GETADDRINFO ) && defined( HAVE_STRUCT_SOCKADDR_IN6 )
+#if defined( HAVE_GETADDRINFO ) && defined( HAVE_IPV6 )
case AF_INET6: {
struct sockaddr_in6 *sa =
(struct sockaddr_in6 *)*sal;