Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- Fixed bug #62025 (__ss_family was changed on AIX 5.3)

  • Loading branch information...
commit ffe8303f24bd1db8af1e64e99c9f7edca4940d95 1 parent 867447f
@felipensp felipensp authored
Showing with 18 additions and 0 deletions.
  1. +15 −0 ext/sockets/config.m4
  2. +3 −0  ext/sockets/sockets.c
View
15 ext/sockets/config.m4
@@ -27,6 +27,21 @@ 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,
+ [
+ AC_TRY_COMPILE([
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netdb.h>
+ ], [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
PHP_NEW_EXTENSION([sockets], [sockets.c multicast.c], [$ext_shared])
PHP_INSTALL_HEADERS([ext/sockets/], [php_sockets.h])
View
3  ext/sockets/sockets.c
@@ -77,6 +77,9 @@
# define IS_INVALID_SOCKET(a) (a->bsd_socket < 0)
# define set_errno(a) (errno = a)
# include "php_sockets.h"
+# if defined(AIX) && !defined(HAVE_SA_SS_FAMILY)
+# define ss_family __ss_family
+# endif
# if HAVE_IF_NAMETOINDEX
# include <net/if.h>
# endif
Please sign in to comment.
Something went wrong with that request. Please try again.