added check for net/bpf.h in configure.ac

This commit is contained in:
2020-11-16 16:55:22 +00:00
parent 330135bb26
commit 802b8038bd
4 changed files with 10 additions and 3 deletions

View File

@ -217,6 +217,9 @@
/* Define to 1 if you have the <netpacket/packet.h> header file. */
#undef HAVE_NETPACKET_PACKET_H
/* Define to 1 if you have the <net/bpf.h> header file. */
#undef HAVE_NET_BPF_H
/* Define to 1 if you have the <net/if_dl.h> header file. */
#undef HAVE_NET_IF_DL_H

View File

@ -55,7 +55,9 @@
# include <sys/ioctl.h>
#endif
#include <net/bpf.h>
#if defined(HAVE_NET_BPF_H)
# include <net/bpf.h>
#endif
#if defined(__linux__)
# include <limits.h>
@ -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: