From: Guy Harris Date: Wed, 19 Feb 2020 02:25:08 +0000 (-0800) Subject: Always assume we have SIOCBONDINFOQUERY on Linux. X-Git-Tag: libpcap-1.10-bp~265 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/1a68396cebeb77650eb57be459877c32b8fac00a Always assume we have SIOCBONDINFOQUERY on Linux. It was introduced long before 2.6.27, and we require 2.6.27 or newer, so we can just assume we have it. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 4697905d..8ed161fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -396,12 +396,6 @@ main(void) HAVE_PF_NAT_THROUGH_PF_NORDR) endif(HAVE_NET_PFVAR_H) check_include_file(netinet/if_ether.h HAVE_NETINET_IF_ETHER_H) - if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - # - # linux/if_bonding.h requires sys/socket.h. - # - check_include_files("sys/socket.h;linux/if_bonding.h" HAVE_LINUX_IF_BONDING_H) - endif() endif(NOT WIN32) # diff --git a/cmakeconfig.h.in b/cmakeconfig.h.in index 0d7cd6f6..c7085d88 100644 --- a/cmakeconfig.h.in +++ b/cmakeconfig.h.in @@ -93,9 +93,6 @@ /* define if we have the Linux getprotobyname_r() */ #cmakedefine HAVE_LINUX_GETPROTOBYNAME_R 1 -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_LINUX_IF_BONDING_H 1 - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_LINUX_NET_TSTAMP_H 1 diff --git a/config.h.in b/config.h.in index 9de00b3b..cbec4928 100644 --- a/config.h.in +++ b/config.h.in @@ -102,9 +102,6 @@ /* define if we have the Linux getprotobyname_r() */ #undef HAVE_LINUX_GETPROTOBYNAME_R -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_IF_BONDING_H - /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_NET_TSTAMP_H diff --git a/configure b/configure index 1e49e86c..7bb35ef6 100755 --- a/configure +++ b/configure @@ -5244,28 +5244,6 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi case "$host_os" in -linux*|uclinux*) - # - # linux/if_bonding.h requires sys/socket.h. - # - for ac_header in linux/if_bonding.h -do : - ac_fn_c_check_header_compile "$LINENO" "linux/if_bonding.h" "ac_cv_header_linux_if_bonding_h" " -#include -#include - -" -if test "x$ac_cv_header_linux_if_bonding_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LINUX_IF_BONDING_H 1 -_ACEOF - -fi - -done - - ;; - haiku*) # # Haiku needs _BSD_SOURCE for the _IO* macros because it doesn't use them. diff --git a/configure.ac b/configure.ac index c5365380..d63ccc7a 100644 --- a/configure.ac +++ b/configure.ac @@ -85,17 +85,6 @@ if test "$ac_cv_header_net_pfvar_h" = yes; then fi case "$host_os" in -linux*|uclinux*) - # - # linux/if_bonding.h requires sys/socket.h. - # - AC_CHECK_HEADERS(linux/if_bonding.h,,, - [ -#include -#include - ]) - ;; - haiku*) # # Haiku needs _BSD_SOURCE for the _IO* macros because it doesn't use them. diff --git a/pcap-linux.c b/pcap-linux.c index 02e0c539..6d5bde68 100644 --- a/pcap-linux.c +++ b/pcap-linux.c @@ -124,18 +124,10 @@ #include #endif -#ifdef HAVE_LINUX_IF_BONDING_H -#include - /* - * The ioctl code to use to check whether a device is a bonding device. + * For checking whether a device is a bonding device. */ -#if defined(SIOCBONDINFOQUERY) - #define BOND_INFO_QUERY_IOCTL SIOCBONDINFOQUERY -#elif defined(BOND_INFO_QUERY_OLD) - #define BOND_INFO_QUERY_IOCTL BOND_INFO_QUERY_OLD -#endif -#endif /* HAVE_LINUX_IF_BONDING_H */ +#include /* * Got Wireless Extensions? @@ -880,7 +872,6 @@ added: static int is_bonding_device(int fd, const char *device) { -#ifdef BOND_INFO_QUERY_IOCTL struct ifreq ifr; ifbond ifb; @@ -888,9 +879,8 @@ is_bonding_device(int fd, const char *device) pcap_strlcpy(ifr.ifr_name, device, sizeof ifr.ifr_name); memset(&ifb, 0, sizeof ifb); ifr.ifr_data = (caddr_t)&ifb; - if (ioctl(fd, BOND_INFO_QUERY_IOCTL, &ifr) == 0) + if (ioctl(fd, SIOCBONDINFOQUERY, &ifr) == 0) return 1; /* success, so it's a bonding device */ -#endif /* BOND_INFO_QUERY_IOCTL */ return 0; /* no, it's not a bonding device */ }