Solaris sockaddr_storage check fails + patch

Chris Parker cparker at starnetusa.net
Fri Nov 4 18:05:16 CET 2005


It appears that sockaddr_storage check is failing.

 From ./configure :
...
checking for struct in6_addr... yes
checking for struct sockaddr_storage... no
checking for struct sockaddr_in6... yes
checking for struct addrinfo... yes
...

So it gets included in 'missing.h'.

Subsequent make now chokes with:

gcc -g -O2 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DOPENSSL_NO_KRB5 - 
D_LIBRADIUS -I../include -DHMAC_SHA1_DATA_PROBLEMS -c dict.c  -fPIC - 
DPIC -o .libs/dict.o
In file included from ../include/libradius.h:37,
                  from dict.c:42:
/usr/include/sys/socket.h:239: redefinition of `struct sockaddr_storage'
gmake[4]: *** [dict.lo] Error 1
gmake[4]: Leaving directory `/work/working-code/radiusd/src/lib'
gmake[3]: *** [common] Error 2
gmake[3]: Leaving directory `/work/working-code/radiusd/src'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory `/work/working-code/radiusd/src'
gmake[1]: *** [common] Error 2
gmake[1]: Leaving directory `/work/working-code/radiusd'
*** Error code 2
make: Fatal error: Command failed for target `all'

config.log shows:

....
configure:23179: checking for struct sockaddr_storage
configure:23208: gcc -c -g -O2 -D_REENTRANT - 
D_POSIX_PTHREAD_SEMANTICS -DOPENSSL_NO_KRB5  conftest.c
 >&5
conftest.c: In function `main':
conftest.c:69: sizeof applied to an incomplete type
configure:23214: $? = 1
configure: failed program was:
| /* confdefs.h.  */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #ifdef __cplusplus
| extern "C" void std::exit (int) throw (); using std::exit;
| #endif
| #define _FILE_OFFSET_BITS 64
| #define WORDS_BIGENDIAN 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define ASCEND_BINARY
| #define HAVE_PTHREAD_H 1
| #define HAVE_LIBSOCKET 1
| #define HAVE_LIBRESOLV 1
| #define HAVE_LIBNSL 1
| #define HAVE_DIRENT_H 1
| #define STDC_HEADERS 1
| #define TIME_WITH_SYS_TIME 1
| #define HAVE_SYS_WAIT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_CRYPT_H 1
| #define HAVE_ERRNO_H 1
| #define HAVE_MALLOC_H 1
| #define HAVE_UTMP_H 1
| #define HAVE_UTMPX_H 1
| #define HAVE_SIGNAL_H 1
| #define HAVE_SYS_SELECT_H 1
| #define HAVE_SYSLOG_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDIO_H 1
| #define HAVE_NETDB_H 1
| #define HAVE_SEMAPHORE_H 1
| #define HAVE_ARPA_INET_H 1
| #define HAVE_NETINET_IN_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_SOCKET_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_SYS_WAIT_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_SYS_FCNTL_H 1
| #define HAVE_NET_IF_H 1
| #define HAVE_REGEX_H
| #define HAVE_REG_EXTENDED
| #define HAVE_STRUCT_IN6_ADDR 1
| /* end confdefs.h.  */
|
| #ifdef HAVE_NETINET_IN_H
| #include <netinet/in.h>
| #endif
|
|
| int
| main ()
| {
| if ((struct sockaddr_storage *) 0)
|   return 0;
| if (sizeof (struct sockaddr_storage))
|   return 0;
|   ;
|   return 0;
| }
configure:23237: result: no
.....

Adding an '#include <sys/socket.h>' to the conftest file passes the  
test.

Possible patch:

Index: configure.in
===================================================================
RCS file: /source/radiusd/configure.in,v
retrieving revision 1.222
diff -p -r1.222 configure.in
*** configure.in        1 Nov 2005 19:04:49 -0000       1.222
--- configure.in        4 Nov 2005 17:01:57 -0000
*************** AC_CHECK_TYPE(struct sockaddr_storage, A
*** 662,667 ****
--- 662,670 ----
   #ifdef HAVE_NETINET_IN_H
   #include <netinet/in.h>
   #endif
+ #ifdef HAVE_SYS_SOCKET_H
+ #include <sys/socket.h>
+ #endif
   ])

   AC_CHECK_TYPE(struct sockaddr_in6, AC_DEFINE 
(HAVE_STRUCT_SOCKADDR_IN6, 1, [IPv6 socket addresses]), [], [


-Chris
--
Chris Parker
Director, Engineering
StarNet A Service of US LEC

(888)212-0099   Fax (847)963-1302
Wholesale Internet Services     http://www.megapop.net
VoiceEclipse, The Fresh Alternative http://www.voiceeclipse.com

NOTICE: Message is sent IN CONFIDENCE to addressees. It may contain
information that is privileged, proprietary or confidential.




More information about the Freeradius-Devel mailing list