diff --git a/configure.ac b/configure.ac index 09a362d..27934b8 100644 --- a/configure.ac +++ b/configure.ac @@ -490,6 +490,19 @@ AC_CHECK_TYPES([sa_family_t], [], [], ]] ) +AC_CHECK_HEADERS([net/bpf.h]) +AC_CHECK_TYPES([struct bpf_timeval], [], [], +[[ +#ifdef HAVE_SYS_TYPES_H +#include +#endif + +#ifdef HAVE_NET_BPF_H +#include +#endif +]] +) + ############## drop optimization flags if requested ################ # Should we disable optimization? diff --git a/src/tcpflow.h b/src/tcpflow.h index 627e277..6d191ab 100644 --- a/src/tcpflow.h +++ b/src/tcpflow.h @@ -297,7 +297,7 @@ inline const timeval &tvshift(struct timeval &tv,const struct timeval &tv_) return tv; } -#if __has_include("net/bpf.h") +#ifdef HAVE_STRUCT_BPF_TIMEVAL inline const timeval &tvshift(struct timeval &tv,const struct bpf_timeval &tv_) { tv.tv_sec = tv_.tv_sec + datalink_tdelta;