Skip to content

Commit

Permalink
- Fixed bug #62025 (__ss_family was changed on AIX 5.3)
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed May 20, 2012
1 parent 867447f commit ffe8303
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ext/sockets/config.m4
Expand Up @@ -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])
Expand Down
3 changes: 3 additions & 0 deletions ext/sockets/sockets.c
Expand Up @@ -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
Expand Down

0 comments on commit ffe8303

Please sign in to comment.