From 7181ae471345d4e4e85d5edd5341ff7f156de01d Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 30 Mar 2015 11:21:17 -0700 Subject: Work around a Linux bonding driver bug (and the lack of a libpcap workaround). The bonding driver does not properly handle unknown ioctls; it returns ENODEV rather than ENOTSUP, EOPNOTSUPP, ENOTTY, or a "not supported" error of that type. This causes problems detailed in bug 11058. On Linux, check for bonding devices before checking for monitor-mode support. While we're at it, get rid of a commented-out include of CheckCSourceCompiles (it's presumably already been implicitly included by other functions that use it). Bug: 11058 Change-Id: I13035de0650634c51a52f262829b2b6fb86b39e9 Reviewed-on: https://code.wireshark.org/review/7856 Petri-Dish: Guy Harris Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris --- ConfigureChecks.cmake | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'ConfigureChecks.cmake') diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 69ca619068..de25c64874 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -53,6 +53,35 @@ check_include_file("unistd.h" HAVE_UNISTD_H) check_include_file("windows.h" HAVE_WINDOWS_H) check_include_file("winsock2.h" HAVE_WINSOCK2_H) +# +# On Linux, check for some additional headers, which we need as a +# workaround for a bonding driver bug and for libpcap's current lack +# of its own workaround for that bug. +# +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + # + # Those header files require . + # + check_c_source_compiles( + "#include + #include + int main(void) + { + return 0; + }" + HAVE_LINUX_SOCKIOS_H + ) + check_c_source_compiles( + "#include + #include + int main(void) + { + return 0; + }" + HAVE_LINUX_IF_BONDING_H + ) +endif() + #Functions include(CheckFunctionExists) include(CheckSymbolExists) @@ -107,7 +136,6 @@ check_struct_has_member("struct tm" tm_zone time.h HAVE_TM_ZONE) check_symbol_exists(tzname "time.h" HAVE_TZNAME) # Check for stuff that isn't testable via the tests above -#include(CheckCSourceCompiles) # # *If* we found libnl, check if we can use nl80211 stuff with it. -- cgit v1.2.1