From: Guy Harris Date: Sat, 26 Jun 2021 02:25:52 +0000 (-0700) Subject: Revert "pcap-npf.c: handle NdisMediumIP." X-Git-Tag: libpcap-1.10.2~400 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/0ac100bc954aaaf4cdb30df57cc6c8d2dbe10095 Revert "pcap-npf.c: handle NdisMediumIP." This reverts commit ef0e7b15fe871d79e678a3482b0c5a02171dacfe. We'll set _WIN32_WINNT to "Windows 7" when building for MinGW, to force it to give us NdisMediumIP, and then we'll apply the original pull request to add NdisMediumIP support. (cherry picked, in effect, from commit 460c2f545b1d269da3d069bed2975ecde9a0b804) --- diff --git a/CMakeLists.txt b/CMakeLists.txt index c134e6e7..b83fbbd7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1130,32 +1130,6 @@ if(WIN32) # Set the capture type to NPF. # set(PCAP_TYPE npf) - - # - # Check whether ntddndis.h defines NdisMediumIP. - # SDKs for older versions of Windows (Windows 7, - # Windows 8?) don't define it. - # It's an enum value, so this is the only way - # to test whether it's defined. - # - check_c_source_compiles( -"/* Old-school MinGW have these headers in a different place. - */ -#include -#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) - #include - #include -#else - #include /* MSVC/TDM-MinGW/MinGW64 */ -#endif - -int -main(void) -{ - return NdisMediumIP; -} -" - HAVE_NDIS_MEDIUM_IP) else() # # We don't have any capture type we know about, so just use diff --git a/cmakeconfig.h.in b/cmakeconfig.h.in index 9f1d9647..ee51ac63 100644 --- a/cmakeconfig.h.in +++ b/cmakeconfig.h.in @@ -99,9 +99,6 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_MEMORY_H 1 -/* Define to 1 if you have the `NdisMediumIP` enum value. */ -#cmakedefine HAVE_NDIS_MEDIUM_IP 1 - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_NETPACKET_PACKET_H 1 diff --git a/pcap-npf.c b/pcap-npf.c index b46a3c5e..52aee78a 100644 --- a/pcap-npf.c +++ b/pcap-npf.c @@ -1127,12 +1127,6 @@ pcap_activate_npf(pcap_t *p) p->linktype = DLT_RAW; break; -#ifdef HAVE_NDIS_MEDIUM_IP - case NdisMediumIP: - p->linktype = DLT_RAW; - break; -#endif - default: /* * An unknown medium type is assumed to supply Ethernet