# HG changeset patch # User Matt Johnston # Date 1150127834 0 # Node ID e17f0333c21e4dc02528ff0e60618bf032ba926f # Parent 8f3ec7c104d9ea3579ff3fca28558f5f126a5c06 Another stab at getting ss_family happy on older glibc diff -r 8f3ec7c104d9 -r e17f0333c21e configure.in --- a/configure.in Mon Jun 12 14:41:32 2006 +0000 +++ b/configure.in Mon Jun 12 15:57:14 2006 +0000 @@ -342,7 +342,7 @@ #endif ]) -AC_CHECK_MEMBERS([struct utmpx.ut_host, struct utmpx.ut_syslen, struct utmpx.ut_type, struct utmpx.ut_id, struct utmpx.ut_addr, struct utmpx.ut_addr_v6, struct utmpx.ut_time, struct utmpx.ut_tv, struct sockaddr_storage.ss_family, struct sockadd_storage.__family],,,[ +AC_CHECK_MEMBERS([struct utmpx.ut_host, struct utmpx.ut_syslen, struct utmpx.ut_type, struct utmpx.ut_id, struct utmpx.ut_addr, struct utmpx.ut_addr_v6, struct utmpx.ut_time, struct utmpx.ut_tv],,,[ #include #include #if HAVE_UTMPX_H @@ -350,6 +350,8 @@ #endif ]) +AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family],,,[]) + AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent) AC_CHECK_FUNCS(utmpname) AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline ) diff -r 8f3ec7c104d9 -r e17f0333c21e dbutil.c --- a/dbutil.c Mon Jun 12 14:41:32 2006 +0000 +++ b/dbutil.c Mon Jun 12 15:57:14 2006 +0000 @@ -400,7 +400,10 @@ len = sizeof(struct sockaddr_storage); /* Some platforms such as Solaris 8 require that len is the length - * of the specific structure. */ + * of the specific structure. Some older linux systems (glibc 2.1.3 + * such as debian potato) have sockaddr_storage.__ss_family instead + * but we'll ignore them */ +#ifdef HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY if (addr->ss_family == AF_INET) { len = sizeof(struct sockaddr_in); } @@ -409,6 +412,7 @@ len = sizeof(struct sockaddr_in6); } #endif +#endif ret = getnameinfo((struct sockaddr*)addr, len, hbuf, sizeof(hbuf), sbuf, sizeof(sbuf), NI_NUMERICSERV | NI_NUMERICHOST); @@ -448,6 +452,7 @@ len = sizeof(struct sockaddr_storage); /* Some platforms such as Solaris 8 require that len is the length * of the specific structure. */ +#ifdef HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY if (addr->ss_family == AF_INET) { len = sizeof(struct sockaddr_in); } @@ -456,6 +461,7 @@ len = sizeof(struct sockaddr_in6); } #endif +#endif ret = getnameinfo((struct sockaddr*)addr, len, hbuf, sizeof(hbuf), diff -r 8f3ec7c104d9 -r e17f0333c21e includes.h --- a/includes.h Mon Jun 12 14:41:32 2006 +0000 +++ b/includes.h Mon Jun 12 15:57:14 2006 +0000 @@ -135,13 +135,6 @@ #define LOG_AUTHPRIV LOG_AUTH #endif -/* glibc 2.1.3 systems have sockaddr_storage.__ss_family rather than - * sockaddr_storage.ss_family */ -#if !defined(HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY) \ - && defined(HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY) -#define ss_family __ss_family -#endif - /* so we can avoid warnings about unused params (ie in signal handlers etc) */ #ifdef UNUSED #elif defined(__GNUC__)