mirror of
https://github.com/php/php-src.git
synced 2026-03-28 02:02:32 +01:00
Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5: - Fixed bug #65923 (ext/socket assumes AI_V4MAPPED is defined)
This commit is contained in:
@@ -16,10 +16,10 @@ if test "$PHP_SOCKETS" != "no"; then
|
||||
|
||||
if test "$ac_cv_cmsghdr" = yes; then
|
||||
AC_DEFINE(HAVE_CMSGHDR,1,[Whether you have struct cmsghdr])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_CHECK_FUNCS([hstrerror socketpair if_nametoindex if_indextoname])
|
||||
AC_CHECK_HEADERS([netdb.h netinet/tcp.h sys/un.h sys/sockio.h errno.h])
|
||||
AC_CHECK_HEADERS([netdb.h netinet/tcp.h sys/un.h sys/sockio.h errno.h])
|
||||
AC_TRY_COMPILE([
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
@@ -27,7 +27,7 @@ if test "$PHP_SOCKETS" != "no"; then
|
||||
[AC_DEFINE(MISSING_MSGHDR_MSGFLAGS, 1, [ ])]
|
||||
)
|
||||
AC_DEFINE([HAVE_SOCKETS], 1, [ ])
|
||||
|
||||
|
||||
dnl Check for fied ss_family in sockaddr_storage (missing in AIX until 5.3)
|
||||
AC_CACHE_CHECK([for field ss_family in struct sockaddr_storage], ac_cv_ss_family,
|
||||
[
|
||||
@@ -38,11 +38,24 @@ if test "$PHP_SOCKETS" != "no"; then
|
||||
], [struct sockaddr_storage sa_store; sa_store.ss_family = AF_INET6;],
|
||||
ac_cv_ss_family=yes, ac_cv_ss_family=no)
|
||||
])
|
||||
|
||||
|
||||
if test "$ac_cv_ss_family" = yes; then
|
||||
AC_DEFINE(HAVE_SA_SS_FAMILY,1,[Whether you have sockaddr_storage.ss_family])
|
||||
fi
|
||||
|
||||
dnl Check for AI_V4MAPPED flag
|
||||
AC_CACHE_CHECK([if getaddrinfo supports AI_V4MAPPED],[ac_cv_gai_ai_v4mapped],
|
||||
[
|
||||
AC_TRY_COMPILE([
|
||||
#include <netdb.h>
|
||||
], [int flag = AI_V4MAPPED;],
|
||||
ac_cv_gai_ai_v4mapped=yes, ac_cv_gai_ai_v4mapped=no)
|
||||
])
|
||||
|
||||
if test "$ac_cv_gai_ai_v4mapped" = yes; then
|
||||
AC_DEFINE(HAVE_AI_V4MAPPED,1,[Whether you have AI_V4MAPPED])
|
||||
fi
|
||||
|
||||
PHP_NEW_EXTENSION([sockets], [sockets.c multicast.c conversions.c sockaddr_conv.c sendrecvmsg.c], [$ext_shared])
|
||||
PHP_INSTALL_HEADERS([ext/sockets/], [php_sockets.h])
|
||||
fi
|
||||
|
||||
@@ -27,7 +27,11 @@ int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_
|
||||
|
||||
memset(&hints, 0, sizeof(struct addrinfo));
|
||||
hints.ai_family = AF_INET6;
|
||||
#if HAVE_AI_V4MAPPED
|
||||
hints.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG;
|
||||
#else
|
||||
hints.ai_flags = AI_ADDRCONFIG;
|
||||
#endif
|
||||
getaddrinfo(string, NULL, &hints, &addrinfo);
|
||||
if (!addrinfo) {
|
||||
#ifdef PHP_WIN32
|
||||
|
||||
Reference in New Issue
Block a user