From 6afef7d624fbf734d93ebfe95689a282b202aa3c Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 20 Dec 2007 15:59:39 +0100 Subject: r26550: libreplace: fallback to __ss_family of struct sockaddr_storage metze (This used to be commit 11bdc9bed80b9842ac1ab8f22509a5d191cddc91) --- source4/lib/replace/libreplace.m4 | 20 ++++++++++++++++++++ source4/lib/replace/system/network.h | 9 +++++++++ 2 files changed, 29 insertions(+) diff --git a/source4/lib/replace/libreplace.m4 b/source4/lib/replace/libreplace.m4 index 7e456b4d03..a577285639 100644 --- a/source4/lib/replace/libreplace.m4 +++ b/source4/lib/replace/libreplace.m4 @@ -152,6 +152,26 @@ AC_HAVE_TYPE([struct sockaddr_in6], [ #include ]) +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 +#include +#include + ]) + +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 +#include +#include + ]) +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) diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index f72b233712..e2fad5f686 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -249,9 +249,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 -- cgit