1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

r26550: libreplace: fallback to __ss_family of struct sockaddr_storage

metze
(cherry picked from commit 11bdc9bed80b9842ac1ab8f22509a5d191cddc91)
(This used to be commit c11122afda52ce787dd1d3357bd85b6ce36b8ca4)
This commit is contained in:
Stefan Metzmacher 2007-12-20 15:59:39 +01:00
parent a2bfb1749c
commit 1e5418edbc
2 changed files with 29 additions and 0 deletions

View File

@ -153,6 +153,26 @@ AC_HAVE_TYPE([struct sockaddr_in6], [
#include <netinet/in.h>
])
if test x"$ac_cv_type_struct_sockaddr_storage" = x"yes"; then
AC_CHECK_MEMBER(struct sockaddr_storage.ss_family,
AC_DEFINE(HAVE_SS_FAMILY, 1, [Defined if struct sockaddr_storage has ss_family field]),,
[
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
])
if test x"$ac_cv_member_struct_sockaddr_storage_ss_family" != x"yes"; then
AC_CHECK_MEMBER(struct sockaddr_storage.__ss_family,
AC_DEFINE(HAVE___SS_FAMILY, 1, [Defined if struct sockaddr_storage has __ss_family field]),,
[
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
])
fi
fi
AC_CHECK_FUNCS(seteuid setresuid setegid setresgid chroot bzero strerror)
AC_CHECK_FUNCS(vsyslog setlinebuf mktime ftruncate chsize rename)
AC_CHECK_FUNCS(waitpid strlcpy strlcat initgroups memmove strdup)

View File

@ -227,9 +227,18 @@ typedef unsigned short int sa_family_t;
#ifdef HAVE_STRUCT_SOCKADDR_IN6
#define sockaddr_storage sockaddr_in6
#define ss_family sin6_family
#define HAVE_SS_FAMILY 1
#else
#define sockaddr_storage sockaddr_in
#define ss_family sin_family
#define HAVE_SS_FAMILY 1
#endif
#endif
#ifndef HAVE_SS_FAMILY
#ifdef HAVE___SS_FAMILY
#define ss_family __ss_family
#define HAVE_SS_FAMILY 1
#endif
#endif