tcpdump mailing list archives
[PATCH] Check for socklen_t in configure
From: Kris Katterjohn <katterjohn () gmail com>
Date: Thu, 28 Feb 2008 21:23:41 -0600
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hey tcpdump-workers, I've attached a patch, and submitted it to the SF.net tracker, to check for socklen_t in configure. pcap-linux.c is the only file that uses it, but the #ifndef test to check if it's all ready defined or not is broken. Currently it assumes that glibc is the only library that defines socklen_t, so when a different lib that defines it is used, compilation fails with a "previous declaration" error. The patch doesn't include the diff from the generated configure because it would make it extremely big, and you probably want to autoconf yourselves anyway. Thanks, Kris Katterjohn -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIVAwUBR8d6uv9K37xXYl36AQKZcBAAtt2zlZGAKy53+Kf9U9XKF53Yp/FFcv5L +b8xIyUTU6ek6fyRVWqTqvEucljPrEtqGPsAdQmwdJ+H2STNQrZuEkHjWwmV+hBS R0chxhMSBktHRJa9PkbniOAtjJxTWX6bmsm49KpHNi4IQrFE0nhWeFDLCg0GGYuH YgmfCyXSYI8ZMr6xlw721ArhewCD2ei14Lzs+Pw8Jza8gf/NSb6TAH7hB21/xXkR wGmIRRDNspSuo1dFyhxBR9Jjv4vBSSziaf+v1p0kLoo57nMjlqbXqFpDAASHsNCe mY1PbG/Cr51Tdy8QEqNcJDLPGyzDaRpkvyq1j4W0pskplytf9pPrJ9trloWJz6Ai 03bUjPEVLcD53Rm3NfqBOYDhQpRAp13qgn4+K69oYY6iWPZtqBBCTj7vuP0BGqI3 wlGQzXa7emSJZGjA+GTsq/57E5F0zqM9gQ4WNL6q2fC7fPkcECDsR/6C6WN8OFjC I6CJd/kSoNuyDbB2DSyZgHfngeQpXvX6sRiRht1EfBRprlYI1t7+EY8dCpcIVh9R 75VjtEqpvOJCkvinDTwBeaJfEnTxV8kIUvGTLCzkPf0d9TgMuw/llknypBN/XAEI 9KRF9xMlJl1Is/velg2g6lwqk06DkIcYhudPihfNaF5hwhT08bzhP5+Zx7OIAucr Znhf1rqI8Ow= =uVdL -----END PGP SIGNATURE-----
Index: config.h.in =================================================================== RCS file: /tcpdump/master/libpcap/config.h.in,v retrieving revision 1.34 diff -u -r1.34 config.h.in --- config.h.in 1 Jan 2008 03:49:26 -0000 1.34 +++ config.h.in 29 Feb 2008 02:51:50 -0000 @@ -146,6 +146,9 @@ /* define if your compiler has __attribute__ */ #undef HAVE___ATTRIBUTE__ +/* Is the socklen_t data type defined? */ +#undef HAVE_SOCKLEN_T + /* IPv6 */ #undef INET6 Index: configure.in =================================================================== RCS file: /tcpdump/master/libpcap/configure.in,v retrieving revision 1.145 diff -u -r1.145 configure.in --- configure.in 4 Feb 2008 21:09:27 -0000 1.145 +++ configure.in 29 Feb 2008 02:52:00 -0000 @@ -349,6 +349,19 @@ fi ]) +AC_MSG_CHECKING(for socklen_t) +AC_TRY_COMPILE([ + #include <sys/types.h> + #include <sys/socket.h> + ], + [ socklen_t x; ], + have_socklen_t=yes, + have_socklen_t=no) +if test "x$have_socklen_t" = "xyes"; then + AC_DEFINE(HAVE_SOCKLEN_T, 1) +fi +AC_MSG_RESULT($have_socklen_t) + AC_MSG_CHECKING(if --enable-ipv6 option is specified) AC_ARG_ENABLE(ipv6, [ --enable-ipv6 build IPv6-capable version]) if test "$enable_ipv6" = "yes"; then Index: pcap-linux.c =================================================================== RCS file: /tcpdump/master/libpcap/pcap-linux.c,v retrieving revision 1.138 diff -u -r1.138 pcap-linux.c --- pcap-linux.c 8 Feb 2008 01:34:49 -0000 1.138 +++ pcap-linux.c 29 Feb 2008 02:52:02 -0000 @@ -174,7 +174,7 @@ #include <linux/filter.h> #endif -#ifndef __GLIBC__ +#ifndef HAVE_SOCKLEN_T typedef int socklen_t; #endif
- This is the tcpdump-workers list. Visit https://cod.sandelman.ca/ to unsubscribe.
Current thread:
- [PATCH] Check for socklen_t in configure Kris Katterjohn (Feb 28)
- Fix pcap-linux.c compilation with non-glibc library Kris Katterjohn (Feb 29)
- Re: Fix pcap-linux.c compilation with non-glibc Bruce M Simpson (Mar 01)
- Re: Fix pcap-linux.c compilation with non-glibc Kris Katterjohn (Mar 01)
- Re: Fix pcap-linux.c compilation with non-glibc Guy Harris (Mar 14)
- Re: Fix pcap-linux.c compilation with non-glibc Bruce M Simpson (Mar 01)
- Re: Fix pcap-linux.c compilation with non-glibc library Kris Katterjohn (Mar 13)
- Fix pcap-linux.c compilation with non-glibc library Kris Katterjohn (Feb 29)