@@ -131,7 +131,6 @@
set(ENABLE_FEATURE_TUN_PERSIST 1)
set(HAVE_LINUX_TYPES_H 1)
set(ENABLE_DCO YES)
- set(HAVE_CMSGHDR YES)
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
set(TARGET_FREEBSD YES)
set(ENABLE_DCO YES)
@@ -185,7 +184,6 @@
check_symbol_exists(sendmsg sys/socket.h HAVE_SENDMSG)
check_symbol_exists(recvmsg sys/socket.h HAVE_RECVMSG)
-check_symbol_exists(cmsghdr sys/socket.h HAVE_CMSGHDR)
check_symbol_exists(openlog syslog.h HAVE_OPENLOG)
check_symbol_exists(syslog syslog.h HAVE_SYSLOG)
check_symbol_exists(getgrnam grp.h HAVE_GETGRNAM)
@@ -193,6 +191,11 @@
check_symbol_exists(getsockname sys/socket.h HAVE_GETSOCKNAME)
check_symbol_exists(getrlimit "sys/time.h;sys/resource.h" HAVE_GETRLIMIT)
+# Checking for existence of structs with check_symbol_exists does not work,
+# so we use check_struct_hash_member with a member instead
+check_struct_has_member("struct cmsghdr" cmsg_len sys/socket.h HAVE_CMSGHDR)
+
+
# Some OS (e.g. FreeBSD) need some basic headers to allow
# including network headers
set(NETEXTRA sys/types.h)