The branch stable/14 has been updated by jrm: URL: https://cgit.FreeBSD.org/src/commit/?id=09db15067248b297bf2d419fa77a3b2e39184a64
commit 09db15067248b297bf2d419fa77a3b2e39184a64 Author: Joseph Mingrone <[email protected]> AuthorDate: 2026-03-15 01:42:55 +0000 Commit: Joseph Mingrone <[email protected]> CommitDate: 2026-04-08 19:09:25 +0000 libpcap: Update to 1.10.6 Changes: https://raw.githubusercontent.com/the-tcpdump-group/libpcap/89e982c37c36ad0bf9f10b7ded421cb42422effa/CHANGES Reviewed by: bms, emaste Obtained from: https://www.tcpdump.org/release/libpcap-1.10.6.tar.gz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D55545 Differential Revision: https://reviews.freebsd.org/D55858 (cherry picked from commit 16cef5f7a65588def71db4fdfa961f959847e3b6) --- contrib/libpcap/CHANGES | 107 ++ contrib/libpcap/CMakeLists.txt | 55 +- contrib/libpcap/CREDITS | 13 + contrib/libpcap/INSTALL.md | 4 + contrib/libpcap/Makefile.in | 12 +- contrib/libpcap/VERSION | 2 +- contrib/libpcap/aclocal.m4 | 11 +- contrib/libpcap/autogen.sh | 41 +- contrib/libpcap/cmake/Modules/FindPacket.cmake | 49 +- contrib/libpcap/cmakeconfig.h.in | 12 +- contrib/libpcap/config.h.in | 8 +- contrib/libpcap/configure | 1097 ++++++++++---------- contrib/libpcap/configure.ac | 37 +- contrib/libpcap/dlpisubs.c | 124 +++ contrib/libpcap/dlpisubs.h | 1 + contrib/libpcap/doc/README.haiku.md | 40 +- contrib/libpcap/doc/README.solaris.md | 24 +- contrib/libpcap/doc/README.windows.md | 175 +++- contrib/libpcap/fad-getad.c | 13 +- contrib/libpcap/fmtutils.c | 2 +- contrib/libpcap/gencode.c | 346 ++++-- contrib/libpcap/grammar.y.in | 13 - contrib/libpcap/ieee80211.h | 6 +- contrib/libpcap/instrument-functions.c | 250 +++++ contrib/libpcap/nametoaddr.c | 452 +++++++- contrib/libpcap/nametoaddr.h | 1 + contrib/libpcap/optimize.c | 2 +- contrib/libpcap/pcap-bpf.c | 40 +- contrib/libpcap/pcap-common.c | 92 +- contrib/libpcap/pcap-dag.c | 5 +- contrib/libpcap/pcap-dbus.c | 4 + contrib/libpcap/pcap-dlpi.c | 348 ++++--- contrib/libpcap/pcap-dpdk.c | 5 +- contrib/libpcap/pcap-haiku.c | 8 +- contrib/libpcap/pcap-int.h | 33 +- contrib/libpcap/pcap-libdlpi.c | 33 +- contrib/libpcap/pcap-linux.c | 636 ++++++++++-- contrib/libpcap/pcap-new.c | 54 +- contrib/libpcap/pcap-npf.c | 100 +- contrib/libpcap/pcap-rpcap.c | 2 +- contrib/libpcap/pcap-savefile.manfile.in | 29 +- contrib/libpcap/pcap-septel.c | 3 +- contrib/libpcap/pcap-snf.c | 5 +- contrib/libpcap/pcap.c | 73 +- contrib/libpcap/pcap/bpf.h | 2 - contrib/libpcap/pcap/dlt.h | 102 +- contrib/libpcap/pcap_close.3pcap | 14 +- contrib/libpcap/pcap_dump_close.3pcap | 11 +- contrib/libpcap/pcap_dump_flush.3pcap | 2 +- contrib/libpcap/pcap_file.3pcap | 2 +- contrib/libpcap/pcap_loop.3pcap | 2 +- contrib/libpcap/pcap_next_ex.3pcap | 2 +- contrib/libpcap/pcap_open_offline.3pcap.in | 8 +- contrib/libpcap/pflog.h | 4 + contrib/libpcap/rpcapd/CMakeLists.txt | 28 +- contrib/libpcap/rpcapd/rpcapd.c | 14 +- contrib/libpcap/scanner.l | 22 - contrib/libpcap/sf-pcap.c | 15 +- contrib/libpcap/testprogs/CMakeLists.txt | 9 +- contrib/libpcap/testprogs/Makefile.in | 5 + contrib/libpcap/testprogs/filtertest.c | 3 + contrib/libpcap/testprogs/fuzz/CMakeLists.txt | 43 - contrib/libpcap/testprogs/fuzz/fuzz_both.c | 101 -- contrib/libpcap/testprogs/fuzz/fuzz_both.options | 2 - contrib/libpcap/testprogs/fuzz/fuzz_filter.c | 43 - contrib/libpcap/testprogs/fuzz/fuzz_filter.options | 2 - contrib/libpcap/testprogs/fuzz/fuzz_pcap.c | 80 -- contrib/libpcap/testprogs/fuzz/fuzz_pcap.options | 2 - contrib/libpcap/testprogs/fuzz/onefile.c | 54 - contrib/libpcap/testprogs/versiontest.c | 29 + lib/libpcap/Makefile | 1 - lib/libpcap/config.h | 261 ++++- sys/net/dlt.h | 175 +++- 73 files changed, 3738 insertions(+), 1667 deletions(-) diff --git a/contrib/libpcap/CHANGES b/contrib/libpcap/CHANGES index bf8701c829a0..cb603f8feac4 100644 --- a/contrib/libpcap/CHANGES +++ b/contrib/libpcap/CHANGES @@ -1,3 +1,110 @@ +Tuesday, December 30, 2025 / The Tcpdump Group + Summary for 1.10.6 libpcap release + General: + Fix "tcpdump -i <n>" for something-only libpcap builds. + gencode: Fix an undefined behavior in gen_mcode(). + gencode: Add a missing free() in gen_scode(). + Remove "DLT_" from the descriptions of two dlt_choices[] entries. + Report the size of time_t in the version string. + Validate remote capture source strings better. + CVE-2025-11961: Fix OOBR and OOBW in pcap_ether_aton(). + Source code: + Remove some unneeded includes. + pcapint_find_function() changed to return "void *" to avoid + warnings. + Clean up code that computes the length of a netmask. + Mind netmap support in pcap_lib_version(). + Link-layer types: + Add LINKTYPE_ETW/DLT_ETW. + Add LINKTYPE_NETANALYZER_NG/DLT_NETANALYZER_NG (pull request + #1008). + Add LINKTYPE_ZBOSS_NCP/DLT_ZBOSS_NCP. + Add LINKTYPE_USB_2_0_LOW_SPEED/DLT_USB_2_0_LOW_SPEED, + LINKTYPE_USB_2_0_FULL_SPEED/DLT_USB_2_0_FULL_SPEED, + LINKTYPE_USB_2_0_HIGH_SPEED/DLT_USB_2_0_HIGH_SPEED + Add LINKTYPE_AUERSWALD_LOG/DLT_AUERSWALD_LOG. + Add LINKTYPE_ZWAVE_TAP/DLT_ZWAVE_TAP. + Add LINKTYPE_SILABS_DEBUG_CHANNEL/DLT_SILABS_DEBUG_CHANNEL. + Add LINKTYPE_FIRA_UCI/DLT_FIRA_UCI. + Rename LINKTYPE_IPMB_LINUX/DLT_IPMB_LINUX to + LINKTYPE_I2C_LINUX/DLT_I2C_LINUX, as it's really just an + encapsulation of I2C, and is also being used for HDMI DDC. + Keep DLT_IPMB_LINUX around as a #define for backwards + compatibility. + Add LINKTYPE_MDB/DLT_MDB. + Add LINKTYPE_DECT_NR/DLT_DECT_NR. + Add LINKTYPE_EDK2_MM/DLT_EDK2_MM. + Add LINKTYPE_DEBUG_ONLY/DLT_DEBUG_ONLY. + Packet filtering: + Make the chunk allocator's alignment more general and + platform-independent. + IEEE 802.11: Fix three undefined behaviors in grammar.y. + Fix IPv4 multicast filtering to only include 224.0.0.0/4. + Fix "(arp|rarp) host NAME" to ignore IPv6 quietly. + Fix ARCnet address parsing. + Linux: + Fix check for mac80211 phydev. + Don't create monitor-mode interface if we're capturing on one. + Expand the table of DSA tag types to include all current types. + Fix an error message when deleting a monN interface. + Fix returning PCAP_ERROR_RFMON_NOTSUP with libnl. + Fix the error message when capure permission is denied. + Fix the error message if PF_PACKET sockets aren't supported. + Fix a file descriptor leak in an error case (pull request #1537). + Handle errors better when checking for a DSA-tagged interface. + Use DLT_DEBUG_ONLY for DSA tags that do not [yet] have a better support. + FreeBSD: + Fix detection and enabling of zero-copy support. + Fix errors in the zero-copy code. + Solaris: + Fix not to ignore logical interfaces in fad-gifc.c and + fad-glifc.c. + Fix attempts to open all-numeric device names with DLPI to + return "no such device". + Fix error returns and messages when an interface has no DLPI + device. + Return all interfaces in pcap_findalldevs() even if they can't be + opened. + HP-UX: + Fix attempts to open all-numeric device names to return + "no such device". + Fix error message if there's no /dev/dlpi device. + Return all interfaces in pcap_findalldevs() even if they can't be + opened. + Windows: + Fix filtering for VLAN-tagged frames. + Add support for Npcap's nanosecond-resolution time stamps in + captures. + CVE-2025-11964: Fix a bug in error message character encoding mapping + from UTF-16 to UTF-8. + Check at create time whether the NPF driver supports nanosecond + precision. + D-Bus: + Fix message leak. + Capture file writing: + Don't close the output stream if it's stdout, just flush it. + Documentation: + Explicitly document that closing a pcap_t for a savefile opened + with pcap_fopen_offline() will close the standard I/O stream. + Building and testing: + Makefile.in: Include instrument-functions.c in the release tarball. + CMake: Fix libnl usage with pkg-config. + CMake: Fix build with CMake 3.31. + CI: Report CMake version in builds. + CI: Visual Studio 2022 builds added, including ARM64 builds; + Visual Studio 2015 builds dropped. + Don't build with sslutils.c if we don't have a TLS library. + Build on Windows with a newer version of OpenSSL. + CMake: generalize handling of non-x86 Windows architectures. + CI: use the -A flag for all Visual Studio generators. + Remove the fuzzing props from the release tarball. + Autoconf: Use AC_SYS_YEAR2038_RECOMMENDED when possible if the + environment variable BUILD_YEAR2038 = yes (via autogen.sh) + DPDK: don't enable it by default. + Update Npcap SDK to 1.15. + autogen.sh: Allow to configure Autoconf warnings. + autogen.sh: Delete all trailing blank lines at end of configure. + Friday, August 30, 2024 / The Tcpdump Group Summary for 1.10.5 libpcap release Source code: diff --git a/contrib/libpcap/CMakeLists.txt b/contrib/libpcap/CMakeLists.txt index 9012ef41769f..8a27687ac355 100644 --- a/contrib/libpcap/CMakeLists.txt +++ b/contrib/libpcap/CMakeLists.txt @@ -13,14 +13,21 @@ else(WIN32) # on a "long-term support" version # of some OS and that # version supplies an older version of CMake; # - # otherwise, require 3.5, so we don't get messages warning - # that support for versions of CMake lower than 3.5 is + # otherwise, if it's a version less than 3.10, require only + # 3.5, just in case somebody is configuring with CMake + # on a "long-term support" version # of some OS and that + # version supplies an older version of CMake; + # + # otherwise, require 3.10, so we don't get messages warning + # that support for versions of CMake lower than 3.10 is # deprecated. # if(CMAKE_VERSION VERSION_LESS "3.5") cmake_minimum_required(VERSION 2.8.12) - else() + elseif(CMAKE_VERSION VERSION_LESS "3.10") cmake_minimum_required(VERSION 3.5) + else() + cmake_minimum_required(VERSION 3.10) endif() endif(WIN32) @@ -506,7 +513,13 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") endif() option(DISABLE_BLUETOOTH "Disable Bluetooth sniffing support" OFF) option(DISABLE_NETMAP "Disable netmap support" OFF) -option(DISABLE_DPDK "Disable DPDK support" OFF) + +# +# Require that DPDK support be explicitly enabled, as the code is +# immensely hard to keep compiling for every random API change +# the DPDK folks make. +# +set(DISABLE_DPDK ON) # # We don't support D-Bus sniffing on macOS; see @@ -578,6 +591,7 @@ include_directories( include(CheckFunctionExists) include(CMakePushCheckState) include(CheckSymbolExists) +include(CheckIncludeFile) if(WIN32) @@ -595,8 +609,11 @@ if(WIN32) # cmake_push_check_state() set(CMAKE_REQUIRED_LIBRARIES ${Packet_LIBRARIES}) + set(CMAKE_REQUIRED_INCLUDES ${Packet_INCLUDE_DIRS}) check_function_exists(PacketIsLoopbackAdapter HAVE_PACKET_IS_LOOPBACK_ADAPTER) check_function_exists(PacketGetTimestampModes HAVE_PACKET_GET_TIMESTAMP_MODES) + check_function_exists(PacketGetInfo HAVE_PACKET_GET_INFO) + check_include_file(npcap-bpf.h HAVE_NPCAP_BPF_H) cmake_pop_check_state() endif(Packet_FOUND) @@ -634,7 +651,6 @@ endif(USE_STATIC_RT) # Detect available platform features ################################################################### -include(CheckIncludeFile) include(CheckIncludeFiles) include(CheckStructHasMember) include(CheckTypeSize) @@ -1244,6 +1260,19 @@ if(NOT WIN32) endif() endif() +# +# Find and print the size of time_t. +# +cmake_push_check_state() +set(CMAKE_EXTRA_INCLUDE_FILES time.h) +check_type_size("time_t" SIZEOF_TIME_T) +if(SIZEOF_TIME_T EQUAL 4) + message(STATUS "32-bit time_t") +elseif(SIZEOF_TIME_T EQUAL 8) + message(STATUS "64-bit time_t") +endif() +cmake_pop_check_state() + if(INET6) message(STATUS "Support IPv6") endif(INET6) @@ -1984,6 +2013,7 @@ else(WIN32) # check_include_file(sys/bufmod.h HAVE_SYS_BUFMOD_H) check_include_file(sys/dlpi_ext.h HAVE_SYS_DLPI_EXT_H) + check_include_file(zone.h HAVE_ZONE_H) # # Checks to see if Solaris has the public libdlpi(3LIB) library. @@ -2025,12 +2055,6 @@ else(WIN32) check_type_size(dl_passive_req_t DL_PASSIVE_REQ_T) cmake_pop_check_state() elseif(PCAP_TYPE STREQUAL "linux") - # - # Do we have the wireless extensions? - # linux/wireless.h requires sys/socket.h. - # - check_include_files("sys/socket.h;linux/wireless.h" HAVE_LINUX_WIRELESS_H) - # # Do we have libnl? # We only want version 3. Version 2 was, apparently, @@ -2043,6 +2067,8 @@ else(WIN32) if(BUILD_WITH_LIBNL) pkg_check_modules(LIBNL libnl-genl-3.0) if(LIBNL_FOUND) + set(HAVE_LIBNL TRUE) + include_directories(${LIBNL_INCLUDE_DIRS}) set(PCAP_LINK_LIBRARIES ${LIBNL_LIBRARIES} ${PCAP_LINK_LIBRARIES}) # @@ -2698,7 +2724,10 @@ if(ENABLE_REMOTE) check_struct_has_member("struct msghdr" msg_flags "ftmacros.h;sys/socket.h" HAVE_STRUCT_MSGHDR_MSG_FLAGS) cmake_pop_check_state() set(PROJECT_SOURCE_LIST_C ${PROJECT_SOURCE_LIST_C} - pcap-new.c pcap-rpcap.c rpcap-protocol.c sockutils.c sslutils.c) + pcap-new.c pcap-rpcap.c rpcap-protocol.c sockutils.c) + if(OPENSSL_FOUND) + set(PROJECT_SOURCE_LIST_C ${PROJECT_SOURCE_LIST_C} sslutils.c) + endif() endif(ENABLE_REMOTE) ################################################################### @@ -2917,7 +2946,6 @@ endif() add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/scanner.c ${CMAKE_CURRENT_BINARY_DIR}/scanner.h - SOURCE ${pcap_SOURCE_DIR}/scanner.l COMMAND ${LEX_EXECUTABLE} -P pcap_ --header-file=scanner.h --nounput -o${CMAKE_CURRENT_BINARY_DIR}/scanner.c ${pcap_SOURCE_DIR}/scanner.l DEPENDS ${pcap_SOURCE_DIR}/scanner.l ) @@ -2992,7 +3020,6 @@ message(STATUS "Parser generator: ${YACC_EXECUTABLE}") # add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/grammar.c ${CMAKE_CURRENT_BINARY_DIR}/grammar.h - SOURCE ${pcap_BINARY_DIR}/grammar.y COMMAND ${YACC_EXECUTABLE} -p pcap_ -o ${CMAKE_CURRENT_BINARY_DIR}/grammar.c -d ${pcap_BINARY_DIR}/grammar.y DEPENDS ${pcap_BINARY_DIR}/grammar.y ) diff --git a/contrib/libpcap/CREDITS b/contrib/libpcap/CREDITS index 78ce6a102cf1..809bcec710de 100644 --- a/contrib/libpcap/CREDITS +++ b/contrib/libpcap/CREDITS @@ -14,6 +14,7 @@ Additional people who have contributed patches (in alphabetical order): Alexander Galanin <al at galanin dot nnov dot ru> Alexander 'Leo' Bergolth <Leo dot Bergolth at wu-wien dot ac dot at> Alexey Kuznetsov <kuznet at ms2 dot inr dot ac dot ru> + Alexey Vishnyakov <vishnya at ispras dot ru> Alex Smith <44322503+MadAlexUK at users dot noreply dot github dot com> Alfredo Alvarez Fernandez <alfredoalvarezernandez at gmail dot com> Ali Abdulkadir <autostart dot ini at gmail dot com> @@ -34,6 +35,7 @@ Additional people who have contributed patches (in alphabetical order): Assar Westerlund <assar at sics dot se> Atzm Watanabe <atzm at atzm dot org> Baptiste Peugnez <baptiste dot peugnez at cea dot fr> + Barnabás Pőcze <pobrn at protonmail dot com> Baruch Siach <baruch at tkos dot co dot il> Bill Parker <wp02855 at gmail dot com> Biswapriyo Nath <nathbappai at gmail dot com> @@ -78,6 +80,7 @@ Additional people who have contributed patches (in alphabetical order): Eli Schwartz <eschwartz93 at gmail dot com> Eric Anderson <anderse at hpl dot hp dot com> Erik de Castro Lopo <erik dot de dot castro dot lopo at sensorynetworks dot com> + Eugene Exarevsky <eugene dot exarevsky at dsr-corporation dot com> Fedor Sakharov <fedor dot sakharov at gmail dot com> Felix Janda <felix dot janda at posteo dot de> Felix Obenhuber <felix at obenhuber dot de> @@ -85,6 +88,7 @@ Additional people who have contributed patches (in alphabetical order): Florent Drouin <Florent dot Drouin at alcatel-lucent dot fr> Florian Fainelli <f dot fainelli at gmail dot com> François Revol <revol at free dot fr> + Frank Gorgas-Waller <frank dot gorgas-waller at auerswald dot de> Franz Schaefer <schaefer at mond dot at> frederich <frederich at sourceforge dot net> Fulko Hew <fulko dot hew at gmail dot com> @@ -95,6 +99,7 @@ Additional people who have contributed patches (in alphabetical order): George Neville-Neil <gnn at freebsd dot org> Gerald Combs <gerald at zing dot org> Gerard Garcia <nouboh at gmail dot com> + Gerd Hoffmann <kraxel at redhat dot com> Gianluca Varenni <gianluca dot varenni at gmail dot com> Gilbert Hoyek <gil_hoyek at hotmail dot com> Gisle Vanem <gvanem at yahoo dot no> @@ -106,14 +111,17 @@ Additional people who have contributed patches (in alphabetical order): Gustavo Zacarias <gustavo at zacarias dot com dot ar> Hagen Paul Pfeifer <hagen at jauu dot net> headshog <craaaaaachind at gmail dot com> + Henri Chataing <henrichataing at google dot com> Henri Doreau <hdoreau at sourceforge dot net> Hiroaki KAWAI <kawai at stratosphere dot co dot jp> hopper-vul <hopper dot vul at gmail dot com> Hyung Sik Yoon <hsyn at kr dot ibm dot com> + Ido Yariv <yarivido at gmail dot com> Igor Khristophorov <igor at atdot dot org> Jakub Sitnicki <jsitnicki at gmail dot com> Jakub Zawadzki <darkjames at darkjames dot pl> James Ko <jck at exegin dot com> + Jan Adam <jadam at hilscher dot com> Jan-Philip Velders <jpv at veldersjes dot net> Jason R. Thorpe <thorpej at netbsd dot org> Javier Achirica <achirica at ttd dot net> @@ -124,6 +132,7 @@ Additional people who have contributed patches (in alphabetical order): Jesper Dangaard Brouer <hawk at comx dot dk> Jesper Peterson <jesper at endace dot com> Jesse Gross <jesse at nicira dot com> + Jessica Clarke <jrtc27 at jrtc27 dot com> JHA <jon dot anderson at oracle dot com> jingyu yang <jingleyang at users dot noreply dot github dot com> Jiri Slaby <jirislaby at gmail dot com> @@ -131,6 +140,7 @@ Additional people who have contributed patches (in alphabetical order): Joel <82591719+joelg989 at users dot noreply dot github dot com> Joerg Mayer <jmayer at loplof dot de> John Bankier <jbankier at rainfinity dot com> + John Thacker <johnthacker at gmail dot com> Jon Lindgren <jonl at yubyub dot net> Jon Smirl <jonsmirl at gmail dot com> Jorge Boncompte [DTI2] <jorge at dti2 dot net> @@ -165,6 +175,7 @@ Additional people who have contributed patches (in alphabetical order): Mark Pizzolato <List-tcpdump-workers at subscriptions dot pizzolato dot net> Markus Mayer <markus_mayer at sourceforge dot net> Martin Husemann <martin at netbsd dot org> + Martin Kaiser <martin at kaiser dot cx> Márton Németh <nm127 at freemail dot hu> Matias Karhumaa <matias dot karhumaa at gmail dot com> Matt Eaton <agnosticdev at gmail dot com> @@ -183,6 +194,7 @@ Additional people who have contributed patches (in alphabetical order): Milosz Kaniewski <milosz dot kaniewski at gmail dot com> Miroslav Lichvar <mlichvar at redhat dot com> Monroe Williams <monroe at pobox dot com> + mooon04 <mirae dot kim040506 at gmail dot com> Myricom Help <myri at users dot noreply dot github dot com> Nan Xiao <nan at chinadtrace dot org> nic-kaczinsky <68271784+nic-kaczinsky at users dot noreply dot github dot com> @@ -240,6 +252,7 @@ Additional people who have contributed patches (in alphabetical order): Stefan Hudson <hudson at mbay dot net> Stephen Donnelly <stephen at endace dot com> Steve Karg <skarg at users dot sourceforge dot net> + Stig Bjørlykke <stig at bjorlykke dot org> stubbfel <stubbfel at gmail dot com> Takashi Yamamoto <yamt at mwd dot biglobe dot ne dot jp> Tanaka Shin-ya <zstanaka at archer dot livedoor dot com> diff --git a/contrib/libpcap/INSTALL.md b/contrib/libpcap/INSTALL.md index 2787580767fc..a8350607c45f 100644 --- a/contrib/libpcap/INSTALL.md +++ b/contrib/libpcap/INSTALL.md @@ -8,6 +8,10 @@ To build libpcap with the configure script and `make`: run `./autogen.sh` (a shell script). The autogen.sh script will build the `configure` and `config.h.in` files. +* If you build on a Linux 32-bit system, with Autoconf version >= 2.72 +and GNU C Library version >= 2.34, run `export BUILD_YEAR2038=yes` +before running `./autogen.sh` to build with 64-bit time_t (Y2038-safe). + On some system, you may need to set the `AUTORECONF` variable, like: `AUTORECONF=autoreconf-2.69 ./autogen.sh` to select the `autoreconf` version you want to use. diff --git a/contrib/libpcap/Makefile.in b/contrib/libpcap/Makefile.in index 207ad8c0db90..fe32c40cf62f 100644 --- a/contrib/libpcap/Makefile.in +++ b/contrib/libpcap/Makefile.in @@ -291,6 +291,7 @@ EXTRA_DIST = \ fad-glifc.c \ grammar.y.in \ install-sh \ + instrument-functions.c \ lbl/os-aix4.h \ lbl/os-aix7.h \ lbl/os-hpux11.h \ @@ -402,14 +403,6 @@ EXTRA_DIST = \ testprogs/filtertest.c \ testprogs/findalldevstest.c \ testprogs/findalldevstest-perf.c \ - testprogs/fuzz/CMakeLists.txt \ - testprogs/fuzz/fuzz_both.c \ - testprogs/fuzz/fuzz_both.options \ - testprogs/fuzz/fuzz_filter.c \ - testprogs/fuzz/fuzz_filter.options \ - testprogs/fuzz/fuzz_pcap.c \ - testprogs/fuzz/fuzz_pcap.options \ - testprogs/fuzz/onefile.c \ testprogs/nonblocktest.c \ testprogs/opentest.c \ testprogs/reactivatetest.c \ @@ -417,6 +410,7 @@ EXTRA_DIST = \ testprogs/threadsignaltest.c \ testprogs/unix.h \ testprogs/valgrindtest.c \ + testprogs/versiontest.c \ testprogs/visopts.py \ testprogs/writecaptest.c @@ -858,7 +852,7 @@ releasetar: tar xf -) && \ echo "No $$TAG tag. Archive build from HEAD."; \ fi && \ - (cd "$$TAG" && "$${AUTORECONF:-autoreconf}" && rm -rf autom4te.cache) && \ + (cd "$$TAG" && ./autogen.sh && rm -rf autom4te.cache) && \ tar cf "$$DIR/$$TAG".tar "$$TAG" && \ rm -f "$$DIR/$$TAG".tar.gz && \ gzip --best "$$DIR/$$TAG".tar && \ diff --git a/contrib/libpcap/VERSION b/contrib/libpcap/VERSION index db77e0ee9760..7b4d9a4ff9bc 100644 --- a/contrib/libpcap/VERSION +++ b/contrib/libpcap/VERSION @@ -1 +1 @@ -1.10.5 +1.10.6 diff --git a/contrib/libpcap/aclocal.m4 b/contrib/libpcap/aclocal.m4 index 374a68db2e7d..1ad668080bd6 100644 --- a/contrib/libpcap/aclocal.m4 +++ b/contrib/libpcap/aclocal.m4 @@ -825,6 +825,11 @@ dnl os-proto.h (symlinked) dnl AC_DEFUN(AC_LBL_DEVEL, [rm -f os-proto.h + # + # MKDEP defaults to no-op (":") if we don't test whether the compiler + # supports generating dependencies + # + MKDEP=: if test "${LBL_CFLAGS+set}" = set; then $1="$$1 ${LBL_CFLAGS}" fi @@ -901,14 +906,16 @@ testme(unsigned short a) # .devel file; why should the ABI for which we produce code # depend on .devel? # + AC_MSG_CHECKING([whether to use an os-proto.h header]) os=`echo $host_os | sed -e 's/\([[0-9]][[0-9]]*\)[[^0-9]].*$/\1/'` name="lbl/os-$os.h" if test -f $name ; then + AC_MSG_RESULT([yes, at "$name"]) ln -s $name os-proto.h AC_DEFINE(HAVE_OS_PROTO_H, 1, - [if there's an os_proto.h for this platform, to use additional prototypes]) + [if there's an os-proto.h for this platform, to use additional prototypes]) else - AC_MSG_WARN(can't find $name) + AC_MSG_RESULT([no]) fi fi]) diff --git a/contrib/libpcap/autogen.sh b/contrib/libpcap/autogen.sh index c84a6b5c5dd2..ee72627ffe23 100755 --- a/contrib/libpcap/autogen.sh +++ b/contrib/libpcap/autogen.sh @@ -1,6 +1,7 @@ #!/bin/sh -e : "${AUTORECONF:=autoreconf}" +: "${BUILD_YEAR2038:=no}" AUTORECONFVERSION=`$AUTORECONF --version 2>&1 | grep "^autoreconf" | sed 's/.*) *//'` @@ -21,5 +22,43 @@ if [ "$maj" = "" ] || [ "$min" = "" ] || \ exit 1 fi +# On Linux, if Autoconf version >= 2.72 and GNU C Library version >= 2.34, +# s/AC_SYS_LARGEFILE/AC_SYS_YEAR2038_RECOMMENDED/ to ensure time_t +# is Y2038-safe. +if [ "$BUILD_YEAR2038" = yes ] && [ "`uname -s`" = Linux ]; then + if [ "$maj" -gt 2 ] || { [ "$maj" -eq 2 ] && [ "$min" -ge 72 ]; }; then + GLIBC_VERSION=`ldd --version|head -1|grep GLIBC|sed 's/.* //'` + maj_glibc=`echo "$GLIBC_VERSION" | cut -d. -f1` + min_glibc=`echo "$GLIBC_VERSION" | cut -d. -f2` + echo "GNU C Library identification: $GLIBC_VERSION" + if [ "$maj_glibc" -gt 2 ] || { [ "$maj_glibc" -eq 2 ] && \ + [ "$min_glibc" -ge 34 ]; }; then + CONFIGURE_AC_NEW="configure.ac.new$$" + sed 's/^AC_SYS_LARGEFILE/AC_SYS_YEAR2038_RECOMMENDED/' \ + <configure.ac >"$CONFIGURE_AC_NEW" + cmp -s configure.ac "$CONFIGURE_AC_NEW" || \ + cat "$CONFIGURE_AC_NEW" >configure.ac + rm -f "$CONFIGURE_AC_NEW" + echo 'Setup to ensure time_t is Y2038-safe.' + fi + fi +fi + echo "$AUTORECONF identification: $AUTORECONFVERSION" -"$AUTORECONF" -f + +# configure.ac is an Autoconf 2.69 file, but it works as expected even with +# Autoconf 2.72. However, in Autoconf versions 2.70 and later obsolete +# construct warnings are enabled by default, which adds varying (depending on +# the branch) amount of noise to the build matrix output, so provide a means +# to silence that. +env ${AUTOCONF_WARNINGS:+WARNINGS="$AUTOCONF_WARNINGS"} "$AUTORECONF" -f + +# Autoconf 2.71 adds a blank line after the final "exit 0" on Linux, but not +# on OpenBSD. Remove this difference to make it easier to compare the result +# of "make releasetar" across different platforms. From sed one-liners: +# "delete all trailing blank lines at end of file (works on all seds)". Don't +# use mktemp(1) because AIX does not have it. +CONFIGURE_NEW="configure.new$$" +sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' <configure >"$CONFIGURE_NEW" +cmp -s configure "$CONFIGURE_NEW" || cat "$CONFIGURE_NEW" >configure +rm -f "$CONFIGURE_NEW" diff --git a/contrib/libpcap/cmake/Modules/FindPacket.cmake b/contrib/libpcap/cmake/Modules/FindPacket.cmake index 8224cd3f3e5c..3d31cba83299 100644 --- a/contrib/libpcap/cmake/Modules/FindPacket.cmake +++ b/contrib/libpcap/cmake/Modules/FindPacket.cmake @@ -47,42 +47,27 @@ # (e.g cmake -DPacket_ROOT=C:\path\to\packet [...]) # -# The 64-bit Packet.lib is located under /x64 -if(CMAKE_SIZEOF_VOID_P EQUAL 8) +if(CMAKE_GENERATOR_PLATFORM STREQUAL "Win32") # - # For the WinPcap and Npcap SDKs, the Lib subdirectory of the top-level - # directory contains 32-bit libraries; the 64-bit libraries are in the - # Lib/x64 directory. + # 32-bit x86; no need to look in subdirectories of the SDK's + # Lib directory for the libraries, as the libraries are in + # the Lib directory # - # The only way to *FORCE* CMake to look in the Lib/x64 directory - # without searching in the Lib directory first appears to be to set - # CMAKE_LIBRARY_ARCHITECTURE to "x64". +else() # - # In newer versions of CMake, CMAKE_LIBRARY_ARCHITECTURE is set according to - # the language, e.g., CMAKE_<LANG>_LIBRARY_ARCHITECTURE. So, set the new - # variable, CMAKE_C_LIBRARY_ARCHITECTURE, so that CMAKE_LIBRARY_ARCHITECTURE - # inherits the correct value. + # Platform other than 32-bit x86. # - set(archdetect_c_code " - #ifndef _M_ARM64 - #error Not ARM64 - #endif - int main() { return 0; } - ") - - file(WRITE "${CMAKE_BINARY_DIR}/archdetect.c" "${archdetect_c_code}") - try_compile( - IsArm64 - "${CMAKE_BINARY_DIR}/archdetect" - "${CMAKE_BINARY_DIR}/archdetect.c" - ) - if(IsArm64) - set(CMAKE_C_LIBRARY_ARCHITECTURE "ARM64") - set(CMAKE_LIBRARY_ARCHITECTURE "ARM64") - else() - set(CMAKE_C_LIBRARY_ARCHITECTURE "x64") - set(CMAKE_LIBRARY_ARCHITECTURE "x64") - endif() + # For the WinPcap and Npcap SDKs, the Lib subdirectory of the top-level + # directory contains 32-bit x86 libraries; the libraries for other + # platforms are in subdirectories of the Lib directory whose names + # are the names of the supported platforms. + # + # The only way to *FORCE* CMake to look in the appropriate + # subdirectory of Lib for libraries without searching in the + # Lib directory first appears to be to set + # CMAKE_LIBRARY_ARCHITECTURE to the name of the subdirectory. + # + set(CMAKE_LIBRARY_ARCHITECTURE "${CMAKE_GENERATOR_PLATFORM}") endif() # Find the header diff --git a/contrib/libpcap/cmakeconfig.h.in b/contrib/libpcap/cmakeconfig.h.in index ae7cf5252de8..b7b20fc4da92 100644 --- a/contrib/libpcap/cmakeconfig.h.in +++ b/contrib/libpcap/cmakeconfig.h.in @@ -93,9 +93,6 @@ /* Define to 1 if you have the <linux/usbdevice_fs.h> header file. */ #cmakedefine HAVE_LINUX_USBDEVICE_FS_H 1 -/* Define to 1 if you have the <linux/wireless.h> header file. */ -#cmakedefine HAVE_LINUX_WIRELESS_H 1 - /* Define to 1 if you have the <memory.h> header file. */ #cmakedefine HAVE_MEMORY_H 1 @@ -129,6 +126,9 @@ /* Define to 1 if Packet32 API (Npcap driver) is available */ #cmakedefine HAVE_PACKET32 1 +/* Define to 1 if Npcap BPF extension definitions are available */ +#cmakedefine HAVE_NPCAP_BPF_H 1 + /* Define to 1 if NPcap's version.h is available */ #cmakedefine HAVE_VERSION_H 1 @@ -265,6 +265,9 @@ /* Define to 1 if you have the `PacketIsLoopbackAdapter' function. */ #cmakedefine HAVE_PACKET_IS_LOOPBACK_ADAPTER 1 +/* Define to 1 if you have the `PacketGetInfo' function. */ +#cmakedefine HAVE_PACKET_GET_INFO 1 + /* IPv6 */ #cmakedefine INET6 1 @@ -325,6 +328,9 @@ /* target host supports RDMA sniffing */ #cmakedefine PCAP_SUPPORT_RDMASNIFF 1 +/* The size of `time_t', as computed by sizeof. */ +#cmakedefine SIZEOF_TIME_T @SIZEOF_TIME_T@ + /* Define to 1 if you have the ANSI C header files. */ #cmakedefine STDC_HEADERS 1 diff --git a/contrib/libpcap/config.h.in b/contrib/libpcap/config.h.in index fbc49c1d151a..e3cad6190843 100644 --- a/contrib/libpcap/config.h.in +++ b/contrib/libpcap/config.h.in @@ -102,9 +102,6 @@ /* Define to 1 if you have the <linux/usbdevice_fs.h> header file. */ #undef HAVE_LINUX_USBDEVICE_FS_H -/* Define to 1 if you have the <linux/wireless.h> header file. */ -#undef HAVE_LINUX_WIRELESS_H - /* Define to 1 if you have the <netpacket/packet.h> header file. */ #undef HAVE_NETPACKET_PACKET_H @@ -138,7 +135,7 @@ /* Use OpenSSL */ #undef HAVE_OPENSSL -/* if there's an os_proto.h for this platform, to use additional prototypes */ +/* if there's an os-proto.h for this platform, to use additional prototypes */ #undef HAVE_OS_PROTO_H /* Define to 1 if you have a POSIX-style `strerror_r' function. */ @@ -256,6 +253,9 @@ /* Define to 1 if you have the `vsyslog' function. */ #undef HAVE_VSYSLOG +/* Define to 1 if you have the <zone.h> header file. */ +#undef HAVE_ZONE_H + /* Define to 1 if you have the `_wcserror_s' function. */ #undef HAVE__WCSERROR_S diff --git a/contrib/libpcap/configure b/contrib/libpcap/configure index 61fcd037a07a..4512c34d1293 100755 --- a/contrib/libpcap/configure +++ b/contrib/libpcap/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for pcap 1.10.5. +# Generated by GNU Autoconf 2.71 for pcap 1.10.6. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, @@ -608,8 +608,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='pcap' PACKAGE_TARNAME='pcap' -PACKAGE_VERSION='1.10.5' -PACKAGE_STRING='pcap 1.10.5' +PACKAGE_VERSION='1.10.6' +PACKAGE_STRING='pcap 1.10.6' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1380,7 +1380,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures pcap 1.10.5 to adapt to many kinds of systems. +\`configure' configures pcap 1.10.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1447,7 +1447,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of pcap 1.10.5:";; + short | recursive ) echo "Configuration of pcap 1.10.6:";; esac cat <<\_ACEOF @@ -1502,7 +1502,7 @@ Optional Packages: directory DIR, if supplied). [default=yes, if present] --with-dpdk[=DIR] include DPDK support (located in directory DIR, if - supplied). [default=yes, if present] + supplied). [default=no] Some influential environment variables: CC C compiler command @@ -1611,7 +1611,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -pcap configure 1.10.5 +pcap configure 1.10.6 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1664,6 +1664,53 @@ fi } # ac_fn_c_try_compile +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + # ac_fn_c_try_run LINENO # ---------------------- # Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that @@ -2183,7 +2230,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by pcap $as_me 1.10.5, which was +It was created by pcap $as_me 1.10.6, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -4221,132 +4268,409 @@ if test "$ac_cv_prog_cc_c99" = "no"; then fi # -# Get the size of a void *, to determine whether this is a 32-bit -# or 64-bit build. +# Try to arrange for large file support. # -ac_header= ac_cache= -for ac_item in $ac_header_c_list -do - if test $ac_cache; then - ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" - if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then - printf "%s\n" "#define $ac_item 1" >> confdefs.h - fi - ac_header= ac_cache= - elif test $ac_header; then - ac_cache=$ac_item - else - ac_header=$ac_item - fi -done - - - - - - - - -if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +# Check whether --enable-largefile was given. +if test ${enable_largefile+y} then : + enableval=$enable_largefile; +fi -printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h +if test "$enable_largefile" != no; then -fi -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 -printf %s "checking size of void *... " >&6; } -if test ${ac_cv_sizeof_void_p+y} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +printf %s "checking for special C compiler options needed for large files... " >&6; } +if test ${ac_cv_sys_largefile_CC+y} then : printf %s "(cached) " >&6 else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default" -then : + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ -else $as_nop - if test "$ac_cv_type_void_p" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (void *) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_void_p=0 - fi + ; + return 0; +} +_ACEOF + if ac_fn_c_try_compile "$LINENO" +then : + break fi - +rm -f core conftest.err conftest.$ac_objext conftest.beam + CC="$CC -n32" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_largefile_CC=' -n32'; break fi *** 7144 LINES SKIPPED ***
