]> The Tcpdump Group git mirrors - libpcap/commitdiff
Always assume we have SIOCBONDINFOQUERY on Linux.
authorGuy Harris <[email protected]>
Wed, 19 Feb 2020 02:25:08 +0000 (18:25 -0800)
committerGuy Harris <[email protected]>
Wed, 19 Feb 2020 02:25:08 +0000 (18:25 -0800)
It was introduced long before 2.6.27, and we require 2.6.27 or newer, so
we can just assume we have it.

CMakeLists.txt
cmakeconfig.h.in
config.h.in
configure
configure.ac
pcap-linux.c

index 4697905dc4c6a410c866f784a36c120742e407b1..8ed161fa96649b1e9aee499084c8e63229371972 100644 (file)
@@ -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)
 
 #
index 0d7cd6f68d031d03b407447bf14d2c66ef3f4c39..c7085d88c44f247fad2f9d6840feaa14a3cc79c6 100644 (file)
@@ -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 <linux/if_bonding.h> header file. */
-#cmakedefine HAVE_LINUX_IF_BONDING_H 1
-
 /* Define to 1 if you have the <linux/net_tstamp.h> header file. */
 #cmakedefine HAVE_LINUX_NET_TSTAMP_H 1
 
index 9de00b3ba5040adf13f06c2e380cfa7783eeb9cf..cbec492801f5f26873e2bf351b49192eebcc7ba7 100644 (file)
 /* define if we have the Linux getprotobyname_r() */
 #undef HAVE_LINUX_GETPROTOBYNAME_R
 
-/* Define to 1 if you have the <linux/if_bonding.h> header file. */
-#undef HAVE_LINUX_IF_BONDING_H
-
 /* Define to 1 if you have the <linux/net_tstamp.h> header file. */
 #undef HAVE_LINUX_NET_TSTAMP_H
 
index 1e49e86c61226a089d58814fedc6e51a51306d95..7bb35ef636d8ecdf850eee18a3912b08c3ea248f 100755 (executable)
--- 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 <sys/socket.h>
-#include <linux/if.h>
-
-"
-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.
index c53653809628a3fa9261fc93bef866ccd5c8c57d..d63ccc7a2b51e62894fcb9464ea7a1fe007cb21b 100644 (file)
@@ -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 <sys/socket.h>
-#include <linux/if.h>
-       ])
-       ;;
-
 haiku*)
        #
        # Haiku needs _BSD_SOURCE for the _IO* macros because it doesn't use them.
index 02e0c5390305db090011b48997a436e5d07a5a08..6d5bde68c52f37406b6956d1c473c89bc91b593b 100644 (file)
 #include <linux/net_tstamp.h>
 #endif
 
-#ifdef HAVE_LINUX_IF_BONDING_H
-#include <linux/if_bonding.h>
-
 /*
- * 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 <linux/if_bonding.h>
 
 /*
  * 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 */
 }