-AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
-[
- AC_TRY_COMPILE(
- [#include <sys/socket.h>],
- [socklen_t len = 42; return len;],
- ac_cv_type_socklen_t=yes,
- ac_cv_type_socklen_t=no)
-])
-if test $ac_cv_type_socklen_t = yes; then
- AC_DEFINE(HAVE_SOCKLEN_T)
-fi
+AC_CHECK_TYPES([socklen_t, struct arphdr, struct ether_arp, struct in_addr, struct addrinfo, struct ip, struct icmp, struct in6_addr, struct sockaddr_in6, struct ip6_hdr, struct icmp6_hdr, struct nd_neighbor_solicit, struct nd_opt_hdr], , ,
+ [#ifdef HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_SOCKET_H
+ #include <sys/socket.h>
+ #endif
+ #ifdef HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+ #ifdef HAVE_NET_IF_ARP_H
+ #include <net/if_arp.h>
+ #endif
+ #ifdef HAVE_NETINET_IF_ETHER_H
+ #include <netinet/if_ether.h>
+ #endif
+ #ifdef HAVE_NETINET_IN_SYSTM_H
+ #include <netinet/in_systm.h>
+ #endif
+ #ifdef HAVE_NETINET_IN_H
+ #include <netinet/in.h>
+ #endif
+ #ifdef HAVE_NETINET_IP_H
+ #include <netinet/ip.h>
+ #endif
+ #ifdef HAVE_NETINET_IP_ICMP_H
+ #include <netinet/ip_icmp.h>
+ #endif
+ #ifdef HAVE_NETINET_IP6_H
+ #include <netinet/ip6.h>
+ #endif
+ #ifdef HAVE_NETINET_ICMP6_H
+ #include <netinet/icmp6.h>
+ #endif
+ ]
+)