diff --git a/mio/configure b/mio/configure index e86f6ed..5aaf15b 100755 --- a/mio/configure +++ b/mio/configure @@ -13997,7 +13997,7 @@ fi done -for ac_header in net/if.h net/if_dl.h netpacket/packet.h +for ac_header in net/if.h net/if_dl.h netpacket/packet.h net/bpf.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " diff --git a/mio/configure.ac b/mio/configure.ac index 140a491..378eefd 100644 --- a/mio/configure.ac +++ b/mio/configure.ac @@ -113,7 +113,7 @@ AC_CHECK_HEADERS([sys/resource.h sys/wait.h sys/syscall.h sys/ioctl.h]) AC_CHECK_HEADERS([sys/sendfile.h sys/epoll.h sys/event.h sys/poll.h]) AC_CHECK_HEADERS([sys/sysctl.h sys/socket.h sys/sockio.h sys/un.h]) AC_CHECK_HEADERS([ifaddrs.h tiuser.h linux/netfilter_ipv4.h netinet/in.h netinet/sctp.h]) -AC_CHECK_HEADERS([net/if.h net/if_dl.h netpacket/packet.h], [], [], [ +AC_CHECK_HEADERS([net/if.h net/if_dl.h netpacket/packet.h net/bpf.h], [], [], [ #include #include ]) AC_CHECK_HEADERS([sys/stropts.h sys/macstat.h linux/ethtool.h linux/sockios.h]) diff --git a/mio/lib/mio-cfg.h.in b/mio/lib/mio-cfg.h.in index f5ceee0..565c834 100644 --- a/mio/lib/mio-cfg.h.in +++ b/mio/lib/mio-cfg.h.in @@ -217,6 +217,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_NETPACKET_PACKET_H +/* Define to 1 if you have the header file. */ +#undef HAVE_NET_BPF_H + /* Define to 1 if you have the header file. */ #undef HAVE_NET_IF_DL_H diff --git a/mio/lib/sck.c b/mio/lib/sck.c index 84104d6..06e665f 100644 --- a/mio/lib/sck.c +++ b/mio/lib/sck.c @@ -55,7 +55,9 @@ # include #endif -#include +#if defined(HAVE_NET_BPF_H) +# include +#endif #if defined(__linux__) # include @@ -179,8 +181,10 @@ static mio_syshnd_t open_async_bpf (mio_t* mio) fd = open("/dev/bpf", O_RDWR); if (fd == MIO_SYSHND_INVALID) goto oops; +#if 0 if (ioctl(fd, BIOCIMMEDIATE, &tmp) == -1) goto oops; if (ioctl(fd, BIOCGBLEN, &bufsize) == -1) goto oops; +#endif return fd; oops: