5bc9304
--- a/config.h.in	
5bc9304
+++ a/config.h.in	
5bc9304
@@ -308,6 +308,9 @@ 
5bc9304
 /* define if your struct sigaction has sa_sigaction */
5bc9304
 #undef HAVE_STRUCT_SIGACTION_SA_SIGACTION
5bc9304
 
5bc9304
+/* define if you have struct sock_extended_err */
5bc9304
+#undef HAVE_STRUCT_SOCK_EXTENDED_ERR
5bc9304
+
5bc9304
 /* Define if your struct termios has component c_ispeed */
5bc9304
 #undef HAVE_TERMIOS_ISPEED
5bc9304
 
5bc9304
--- a/configure.in	
5bc9304
+++ a/configure.in	
5bc9304
@@ -80,7 +80,8 @@ AC_HEADER_RESOLV()
5bc9304
 AC_CHECK_HEADERS(termios.h linux/if_tun.h)
5bc9304
 AC_CHECK_HEADERS(net/if_dl.h)
5bc9304
 AC_CHECK_HEADERS(linux/types.h)
5bc9304
-AC_CHECK_HEADER(linux/errqueue.h, AC_DEFINE(HAVE_LINUX_ERRQUEUE_H), [], [#include <linux/types.h>])
5bc9304
+AC_CHECK_HEADER(linux/errqueue.h, AC_DEFINE(HAVE_LINUX_ERRQUEUE_H), [], [#include <sys/time.h>
5bc9304
+#include <linux/types.h>])
5bc9304
 AC_CHECK_HEADERS(sys/utsname.h sys/select.h sys/file.h)
5bc9304
 AC_CHECK_HEADERS(util.h bsd/libutil.h libutil.h sys/stropts.h regex.h)
5bc9304
 AC_CHECK_HEADERS(linux/fs.h linux/ext2_fs.h)
5bc9304
@@ -915,6 +916,22 @@ if test $sc_cv_type_sa_family_t = yes; then
5bc9304
 fi
5bc9304
 AC_MSG_RESULT($sc_cv_type_sa_family_t)
5bc9304
 
5bc9304
+AC_MSG_CHECKING(for struct sock_extended_err)
5bc9304
+AC_CACHE_VAL(sc_cv_struct_sock_extended_err,
5bc9304
+[AC_TRY_COMPILE([#include <linux/types.h>
5bc9304
+#if TIME_WITH_SYS_TIME
5bc9304
+#include <sys/time.h>
5bc9304
+#endif
5bc9304
+#if HAVE_LINUX_ERRQUEUE_H
5bc9304
+#include <linux/errqueue.h>
5bc9304
+#endif],[struct sock_extended_err s;],
5bc9304
+[sc_cv_struct_sock_extended_err=yes],
5bc9304
+[sc_cv_struct_sock_extended_err=no])])
5bc9304
+if test $sc_cv_struct_sock_extended_err = yes; then
5bc9304
+   AC_DEFINE(HAVE_STRUCT_SOCK_EXTENDED_ERR)
5bc9304
+fi
5bc9304
+AC_MSG_RESULT($sc_cv_struct_sock_extended_err)
5bc9304
+
5bc9304
 AC_MSG_CHECKING(for struct sigaction.sa_sigaction)
5bc9304
 AC_CACHE_VAL(sc_cv_struct_sigaction_sa_sigaction,
5bc9304
 [AC_TRY_COMPILE([#include <signal.h>],[struct sigaction s;s.sa_sigaction=0;],
5bc9304
--- a/xio-ip.c	
5bc9304
+++ a/xio-ip.c	
5bc9304
@@ -503,7 +503,7 @@ int xiolog_ancillary_ip(struct cmsghdr *cmsg, int *num,
5bc9304
       return STAT_OK;
5bc9304
 #endif /* defined(IP_PKTINFO) && HAVE_STRUCT_IN_PKTINFO */
5bc9304
 #endif /* WITH_IP4 */
5bc9304
-#ifdef IP_RECVERR
5bc9304
+#if defined(IP_RECVERR) && HAVE_STRUCT_SOCK_EXTENDED_ERR
5bc9304
    case IP_RECVERR: {
5bc9304
       struct sock_extended_err *err =
5bc9304
 	 (struct sock_extended_err *)CMSG_DATA(cmsg);
5bc9304
@@ -521,7 +521,7 @@ int xiolog_ancillary_ip(struct cmsghdr *cmsg, int *num,
5bc9304
 	       err->ee_code, '\0', err->ee_info, '\0', err->ee_data);
5bc9304
       return STAT_OK;
5bc9304
    }
5bc9304
-#endif /* IP_RECVERR */
5bc9304
+#endif /* defined(IP_RECVERR) && HAVE_STRUCT_SOCK_EXTENDED_ERR */
5bc9304
 #ifdef IP_RECVIF
5bc9304
    case IP_RECVIF: {
5bc9304
       /* spec in FreeBSD: /usr/include/net/if_dl.h */