head 1.1; branch 1.1.1; access; symbols netbsd-11-0-RC4:1.1.1.1 netbsd-11-0-RC3:1.1.1.1 tcpdump-4-99-6:1.1.1.2 netbsd-11-0-RC2:1.1.1.1 netbsd-11-0-RC1:1.1.1.1 perseant-exfatfs-base-20250801:1.1.1.1 netbsd-11:1.1.1.1.0.4 netbsd-11-base:1.1.1.1 tcpdump-4-99-5:1.1.1.1 perseant-exfatfs-base-20240630:1.1.1.1 perseant-exfatfs:1.1.1.1.0.2 perseant-exfatfs-base:1.1.1.1 tcpdump-4-99-4:1.1.1.1 TCPDUMP:1.1.1; locks; strict; comment @# @; 1.1 date 2023.08.17.15.57.14; author christos; state Exp; branches 1.1.1.1; next ; commitid 6SL2uKbgSix3J9BE; 1.1.1.1 date 2023.08.17.15.57.14; author christos; state Exp; branches; next 1.1.1.2; commitid 6SL2uKbgSix3J9BE; 1.1.1.2 date 2026.03.19.00.01.00; author christos; state Exp; branches; next ; commitid eaFgVHJVXxuJ3wyG; desc @@ 1.1 log @Initial revision @ text @# # Try to find libpcap. # # To tell this module where to look, a user may set the environment variable # PCAP_ROOT to point cmake to the *root* of a directory with include and # lib subdirectories for pcap.dll (e.g WpdPack or npcap-sdk). # Alternatively, PCAP_ROOT may also be set from cmake command line or GUI # (e.g cmake -DPCAP_ROOT=C:\path\to\pcap [...]) # if(WIN32) # # Building for Windows. # # libpcap isn't set up to install .pc files or pcap-config on Windows, # and it's not clear that either of them would work without a lot # of additional effort. WinPcap doesn't supply them, and neither # does Npcap. # # So just search for them directly. Look for both pcap and wpcap. # Don't bother looking for static libraries; unlike most UN*Xes # (with the exception of AIX), where different extensions are used # for shared and static, Windows uses .lib both for import libraries # for DLLs and for static libraries. # # We don't directly set PCAP_INCLUDE_DIRS or PCAP_LIBRARIES, as # they're not supposed to be cache entries, and find_path() and # find_library() set cache entries. # find_path(PCAP_INCLUDE_DIR pcap.h) # The 64-bit Packet.lib is located under /x64 if(CMAKE_SIZEOF_VOID_P EQUAL 8) # # 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. # # 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". # set(CMAKE_LIBRARY_ARCHITECTURE "x64") endif() find_library(PCAP_LIBRARY NAMES pcap wpcap) # # Do the standard arg processing, including failing if it's a # required package. # include(FindPackageHandleStandardArgs) find_package_handle_standard_args(PCAP DEFAULT_MSG PCAP_INCLUDE_DIR PCAP_LIBRARY ) mark_as_advanced( PCAP_INCLUDE_DIR PCAP_LIBRARY ) if(PCAP_FOUND) set(PCAP_LIBRARIES ${PCAP_LIBRARY}) set(PCAP_INCLUDE_DIRS ${PCAP_INCLUDE_DIR}) endif() else(WIN32) # # Building for UN*X. # # See whether we were handed a QUIET argument, so we can pass it on # to pkg_search_module. Do *NOT* pass on the REQUIRED argument, # because, if pkg-config isn't found, or it is but it has no .pc # files for libpcap, that is *not* necessarily an indication that # libpcap isn't available - not all systems ship pkg-config, and # libpcap didn't have .pc files until libpcap 1.9.0. # if(PCAP_FIND_QUIETLY) set(_quiet "QUIET") endif() # # First, try pkg-config. # Before doing so, set the PKG_CONFIG_PATH environment variable # to include all the directories in CMAKE_PREFIX_PATH. # # *If* we were to require CMake 3.1 or later on UN*X, # pkg_search_module() would do this for us, but, for now, # we're not doing that, in case somebody's building with # CMake on some "long-term support" version, predating # CMake 3.1, of an OS that supplies an earlier # version as a package. # # If we ever set a minimum of 3.1 or later on UN*X, we should # remove the environment variable changes. # # This is based on code in the CMake 3.12.4 FindPkgConfig.cmake, # which is "Distributed under the OSI-approved BSD 3-Clause License." # find_package(PkgConfig) # # Get the current PKG_CONFIG_PATH setting. # set(_pkg_config_path "$ENV{PKG_CONFIG_PATH}") # # Save it, so we can restore it after we run pkg-config. # set(_saved_pkg_config_path "${_pkg_config_path}") if(NOT "${CMAKE_PREFIX_PATH}" STREQUAL "") # # Convert it to a CMake-style path, before we add additional # values to it. # if(NOT "${_pkg_config_path}" STREQUAL "") file(TO_CMAKE_PATH "${_pkg_config_path}" _pkg_config_path) endif() # # Turn CMAKE_PREFIX_PATH into a list of extra paths to add # to _pkg_config_path. # set(_extra_paths "") list(APPEND _extra_paths ${CMAKE_PREFIX_PATH}) # Create a list of the possible pkgconfig subfolder (depending on # the system set(_lib_dirs) if(NOT DEFINED CMAKE_SYSTEM_NAME OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$" AND NOT CMAKE_CROSSCOMPILING)) if(EXISTS "/etc/debian_version") # is this a debian system ? if(CMAKE_LIBRARY_ARCHITECTURE) list(APPEND _lib_dirs "lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig") endif() else() # not debian, check the FIND_LIBRARY_USE_LIB32_PATHS and FIND_LIBRARY_USE_LIB64_PATHS properties get_property(uselib32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS) if(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) list(APPEND _lib_dirs "lib32/pkgconfig") endif() get_property(uselib64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS) if(uselib64 AND CMAKE_SIZEOF_VOID_P EQUAL 8) list(APPEND _lib_dirs "lib64/pkgconfig") endif() get_property(uselibx32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS) if(uselibx32 AND CMAKE_INTERNAL_PLATFORM_ABI STREQUAL "ELF X32") list(APPEND _lib_dirs "libx32/pkgconfig") endif() endif() endif() if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND NOT CMAKE_CROSSCOMPILING) list(APPEND _lib_dirs "libdata/pkgconfig") endif() list(APPEND _lib_dirs "lib/pkgconfig") list(APPEND _lib_dirs "share/pkgconfig") # Check if directories exist and eventually append them to the # pkgconfig path list foreach(_prefix_dir ${_extra_paths}) foreach(_lib_dir ${_lib_dirs}) if(EXISTS "${_prefix_dir}/${_lib_dir}") list(APPEND _pkg_config_path "${_prefix_dir}/${_lib_dir}") list(REMOVE_DUPLICATES _pkg_config_path) endif() endforeach() endforeach() if(NOT "${_pkg_config_path}" STREQUAL "") # remove empty values from the list list(REMOVE_ITEM _pkg_config_path "") file(TO_NATIVE_PATH "${_pkg_config_path}" _pkg_config_path) if(UNIX) string(REPLACE ";" ":" _pkg_config_path "${_pkg_config_path}") string(REPLACE "\\ " " " _pkg_config_path "${_pkg_config_path}") endif() set(ENV{PKG_CONFIG_PATH} "${_pkg_config_path}") endif() endif() pkg_search_module(CONFIG_PCAP ${_quiet} libpcap) set(ENV{PKG_CONFIG_PATH} "${_saved_pkg_config_path}") if(NOT CONFIG_PCAP_FOUND) # # That didn't work. Try pcap-config. # find_program(PCAP_CONFIG pcap-config) if(PCAP_CONFIG) # # We have pcap-config; use it. # if(NOT "${_quiet}" STREQUAL "QUIET") message(STATUS "Found pcap-config") endif() # # If this is a vendor-supplied pcap-config, which we define as # being "a pcap-config in /usr/bin or /usr/ccs/bin" (the latter # is for Solaris and Sun/Oracle Studio), there are some issues. # Work around them. # if("${PCAP_CONFIG}" STREQUAL /usr/bin/pcap-config OR "${PCAP_CONFIG}" STREQUAL /usr/ccs/bin/pcap-config) # # It's vendor-supplied. # if(APPLE) # # This is macOS or another Darwin-based OS. # # That means that /usr/bin/pcap-config it may provide # -I/usr/local/include with --cflags and -L/usr/local/lib # with --libs; if there's no pcap installed under /usr/local, # that will cause the build to fail, and if there is a pcap # installed there, you'll get that pcap even if you don't # want it. Remember that, so we ignore those values. # set(_broken_apple_pcap_config TRUE) elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_SYSTEM_VERSION MATCHES "5[.][0-9.]*") # # This is Solaris 2 or later, i.e. SunOS 5.x. # # At least on Solaris 11; there's /usr/bin/pcap-config, which # reports -L/usr/lib with --libs, causing the 32-bit libraries # to be found, and there's /usr/bin/{64bitarch}/pcap-config, # where {64bitarch} is a name for the 64-bit version of the # instruction set, which reports -L /usr/lib/{64bitarch}, # causing the 64-bit libraries to be found. # # So if we're building 64-bit targets, we replace PCAP_CONFIG # with /usr/bin/{64bitarch}; we get {64bitarch} as the # output of "isainfo -n". # if(CMAKE_SIZEOF_VOID_P EQUAL 8) execute_process(COMMAND "isainfo" "-n" RESULT_VARIABLE ISAINFO_RESULT OUTPUT_VARIABLE ISAINFO_OUTPUT OUTPUT_STRIP_TRAILING_WHITESPACE ) if(ISAINFO_RESULT EQUAL 0) # # Success - change PCAP_CONFIG. # string(REPLACE "/bin/" "/bin/${ISAINFO_OUTPUT}/" PCAP_CONFIG "${PCAP_CONFIG}") endif() endif() endif() endif() # # Now get the include directories. # execute_process(COMMAND "${PCAP_CONFIG}" "--cflags" RESULT_VARIABLE PCAP_CONFIG_RESULT OUTPUT_VARIABLE PCAP_CONFIG_OUTPUT OUTPUT_STRIP_TRAILING_WHITESPACE ) if(NOT PCAP_CONFIG_RESULT EQUAL 0) message(FATAL_ERROR "pcap-config --cflags failed") endif() separate_arguments(CFLAGS_LIST UNIX_COMMAND ${PCAP_CONFIG_OUTPUT}) set(CONFIG_PCAP_INCLUDE_DIRS "") foreach(_arg IN LISTS CFLAGS_LIST) if(_arg MATCHES "^-I") # # Extract the directory by removing the -I. # string(REGEX REPLACE "-I" "" _dir ${_arg}) # # Work around macOS (and probably other Darwin) brokenness, # by not adding /usr/local/include if it's from the broken # Apple pcap-config. # if(NOT _broken_apple_pcap_config OR NOT "${_dir}" STREQUAL /usr/local/include) # Add it to CONFIG_PCAP_INCLUDE_DIRS list(APPEND CONFIG_PCAP_INCLUDE_DIRS ${_dir}) endif() endif() endforeach() # # Now, get the library directories and libraries for dynamic linking. # execute_process(COMMAND "${PCAP_CONFIG}" "--libs" RESULT_VARIABLE PCAP_CONFIG_RESULT OUTPUT_VARIABLE PCAP_CONFIG_OUTPUT OUTPUT_STRIP_TRAILING_WHITESPACE ) if(NOT PCAP_CONFIG_RESULT EQUAL 0) message(FATAL_ERROR "pcap-config --libs failed") endif() separate_arguments(LIBS_LIST UNIX_COMMAND ${PCAP_CONFIG_OUTPUT}) set(CONFIG_PCAP_LIBRARY_DIRS "") set(CONFIG_PCAP_LIBRARIES "") foreach(_arg IN LISTS LIBS_LIST) if(_arg MATCHES "^-L") # # Extract the directory by removing the -L. # string(REGEX REPLACE "-L" "" _dir ${_arg}) # # Work around macOS (and probably other Darwin) brokenness, # by not adding /usr/local/lib if it's from the broken # Apple pcap-config. # if(NOT _broken_apple_pcap_config OR NOT "${_dir}" STREQUAL /usr/local/lib) # Add this directory to CONFIG_PCAP_LIBRARY_DIRS list(APPEND CONFIG_PCAP_LIBRARY_DIRS ${_dir}) endif() elseif(_arg MATCHES "^-l") string(REGEX REPLACE "-l" "" _lib ${_arg}) list(APPEND CONFIG_PCAP_LIBRARIES ${_lib}) endif() endforeach() # # Now, get the library directories and libraries for static linking. # execute_process(COMMAND "${PCAP_CONFIG}" "--libs" "--static" RESULT_VARIABLE PCAP_CONFIG_RESULT OUTPUT_VARIABLE PCAP_CONFIG_OUTPUT ) if(NOT PCAP_CONFIG_RESULT EQUAL 0) message(FATAL_ERROR "pcap-config --libs --static failed") endif() separate_arguments(LIBS_LIST UNIX_COMMAND ${PCAP_CONFIG_OUTPUT}) set(CONFIG_PCAP_STATIC_LIBRARY_DIRS "") set(CONFIG_PCAP_STATIC_LIBRARIES "") foreach(_arg IN LISTS LIBS_LIST) if(_arg MATCHES "^-L") # # Extract the directory by removing the -L. # string(REGEX REPLACE "-L" "" _dir ${_arg}) # # Work around macOS (and probably other Darwin) brokenness, # by not adding /usr/local/lib if it's from the broken # Apple pcap-config. # if(NOT _broken_apple_pcap_config OR NOT "${_dir}" STREQUAL /usr/local/lib) # Add this directory to CONFIG_PCAP_STATIC_LIBRARY_DIRS list(APPEND CONFIG_PCAP_STATIC_LIBRARY_DIRS ${_dir}) endif() elseif(_arg MATCHES "^-l") string(REGEX REPLACE "-l" "" _lib ${_arg}) # # Try to find that library, so we get its full path, as # we do with dynamic libraries. # list(APPEND CONFIG_PCAP_STATIC_LIBRARIES ${_lib}) endif() endforeach() # # We've set CONFIG_PCAP_INCLUDE_DIRS, CONFIG_PCAP_LIBRARIES, and # CONFIG_PCAP_STATIC_LIBRARIES above; set CONFIG_PCAP_FOUND. # set(CONFIG_PCAP_FOUND YES) endif() endif() # # If CONFIG_PCAP_FOUND is set, we have information from pkg-config and # pcap-config; we need to convert library names to library full paths. # # If it's not set, we have to look for the libpcap headers and library # ourselves. # if(CONFIG_PCAP_FOUND) # # Use CONFIG_PCAP_INCLUDE_DIRS as the value for PCAP_INCLUDE_DIRS. # set(PCAP_INCLUDE_DIRS "${CONFIG_PCAP_INCLUDE_DIRS}") # # CMake *really* doesn't like the notion of specifying # "here are the directories in which to look for libraries" # except in find_library() calls; it *really* prefers using # full paths to library files, rather than library names. # foreach(_lib IN LISTS CONFIG_PCAP_LIBRARIES) find_library(_libfullpath ${_lib} HINTS ${CONFIG_PCAP_LIBRARY_DIRS}) list(APPEND PCAP_LIBRARIES ${_libfullpath}) # # Remove that from the cache; we're using it as a local variable, # but find_library insists on making it a cache variable. # unset(_libfullpath CACHE) endforeach() # # Now do the same for the static libraries. # set(SAVED_CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_FIND_LIBRARY_SUFFIXES}") set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") foreach(_lib IN LISTS CONFIG_PCAP_STATIC_LIBRARIES) find_library(_libfullpath ${_lib} HINTS ${CONFIG_PCAP_LIBRARY_DIRS}) list(APPEND PCAP_STATIC_LIBRARIES ${_libfullpath}) # # Remove that from the cache; we're using it as a local variable, # but find_library insists on making it a cache variable. # unset(_libfullpath CACHE) endforeach() set(CMAKE_FIND_LIBRARY_SUFFIXES "${SAVED_CMAKE_FIND_LIBRARY_SUFFIXES}") # # We found libpcap using pkg-config or pcap-config. # set(PCAP_FOUND YES) else(CONFIG_PCAP_FOUND) # # We didn't have pkg-config, or we did but it didn't have .pc files # for libpcap, and we don't have pkg-config, so we have to look for # the headers and libraries ourself. # # We don't directly set PCAP_INCLUDE_DIRS or PCAP_LIBRARIES, as # they're not supposed to be cache entries, and find_path() and # find_library() set cache entries. # # Try to find the header file. # find_path(PCAP_INCLUDE_DIR pcap.h) # # Try to find the library # find_library(PCAP_LIBRARY pcap) # Try to find the static library (XXX - what about AIX?) set(SAVED_CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_FIND_LIBRARY_SUFFIXES}") set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") find_library(PCAP_STATIC_LIBRARY pcap) set(CMAKE_FIND_LIBRARY_SUFFIXES "${SAVED_CMAKE_FIND_LIBRARY_SUFFIXES}") # # This will fail if REQUIRED is set and PCAP_INCLUDE_DIR or # PCAP_LIBRARY aren't set. # include(FindPackageHandleStandardArgs) find_package_handle_standard_args(PCAP DEFAULT_MSG PCAP_INCLUDE_DIR PCAP_LIBRARY ) mark_as_advanced( PCAP_INCLUDE_DIR PCAP_LIBRARY PCAP_STATIC_LIBRARY ) if(PCAP_FOUND) set(PCAP_INCLUDE_DIRS ${PCAP_INCLUDE_DIR}) set(PCAP_LIBRARIES ${PCAP_LIBRARY}) set(PCAP_STATIC_LIBRARIES ${PCAP_STATIC_LIBRARY}) endif(PCAP_FOUND) endif(CONFIG_PCAP_FOUND) endif(WIN32) @ 1.1.1.1 log @Import tcpdump-4.99.4 (last was 4.9.3) Friday, April 7, 2023 / The Tcpdump Group Summary for 4.99.4 tcpdump release Source code: Fix spaces before tabs in indentation. Updated printers: LSP ping: Fix "Unused value" warnings from Coverity. CVE-2023-1801: Fix an out-of-bounds write in the SMB printer. DNS: sync resource types with IANA. ICMPv6: Update the output to show a RPL DAO field name. Geneve: Fix the Geneve UDP port test. Building and testing: Require at least autoconf 2.69. Don't check for strftime(), as it's in C90 and beyond. Update config.{guess,sub}, timestamps 2023-01-01,2023-01-21. Documentation: man: Document TCP flag names better. Thursday, January 12, 2023 / The Tcpdump Group Summary for 4.99.3 tcpdump release Updated printers: PTP: Use the proper values for the control field and print un-allocated values for the message field as "Reserved" instead of "none". Source code: smbutil.c: Replace obsolete function call (asctime) Building and testing: cmake: Update the minimum required version to 2.8.12 (except Windows). CI: Introduce and use TCPDUMP_CMAKE_TAINTED. Makefile.in: Add the releasecheck target. Makefile.in: Add "make -s install" in the releasecheck target. Cirrus CI: Run the "make releasecheck" command in the Linux task. Makefile.in: Add the whitespacecheck target. Cirrus CI: Run the "make whitespacecheck" command in the Linux task. Address all shellcheck warnings in update-test.sh. Makefile.in: Get rid of a remain of gnuc.h. Documentation: Reformat the installation notes (INSTALL.txt) in Markdown. Convert CONTRIBUTING to Markdown. CONTRIBUTING.md: Document the use of "protocol: " in a commit summary. Add a README file for NetBSD. Fix CMake build to set man page section numbers in tcpdump.1 Saturday, December 31, 2022 / The Tcpdump Group Summary for 4.99.2 tcpdump release Updated printers: BGP: Update cease notification decoding to RFC 9003. BGP: decode BGP link-bandwidth extended community properly. BGP: Fix parsing the AIGP attribute BGP: make sure the path attributes don't go past the end of the packet. BGP: Shutdown message can be up to 255 bytes length according to rfc9003 DSA: correctly determine VID. EAP: fix some length checks and output issues. 802.11: Fix the misleading comment regarding "From DS", "To DS" Frame Control Flags. 802.11: Fetch the CF and TIM IEs a field at a time. 802.15.4, BGP, LISP: fix some length checks, compiler warnings, and undefined behavior warnings. PFLOG: handle LINKTYPE_PFLOG/DLT_PFLOG files from all OSes on all OSes. RRCP: support more Realtek protocols than just RRCP. MPLS: show the EXP field as TC, as per RFC 5462. ICMP: redo MPLS Extension code as general ICMP Extension code. VQP: Do not print unknown error codes twice. Juniper: Add some bounds checks. Juniper: Don't treat known DLT_ types as "Unknown". lwres: Fix a length check, update a variable type. EAP: Fix some undefined behaviors at runtime. Ethernet: Rework the length checks, add a length check. IPX: Add two length checks. Zephyr: Avoid printing non-ASCII characters. VRRP: Print the protocol name before any GET_(). DCCP: Get rid of trailing commas in lists. Juniper: Report invalid packets as invalid, not truncated. IPv6: Remove an obsolete code in an always-false #if wrapper. ISAKMP: Use GET_U_1() to replace a direct dereference. RADIUS: Use GET_U_1() to replace a direct dereference. TCP: Fix an invalid check. RESP: Fix an invalid check. RESP: Remove an unnecessary test. Arista: Refine the output format and print HwInfo. sFlow: add support for IPv6 agent, add a length check. VRRP: add support for IPv6. OSPF: Update to match the Router Properties registry. OSPF: Remove two unnecessary dereferences. OSPF: Add support bit Nt RFC3101. OSPFv3: Remove two unnecessary dereferences. ICMPv6: Fix output for Router Renumbering messages. ICMPv6: Fix the Node Information flags. ICMPv6: Remove an unused macro and extra blank lines. ICMPv6: Add a length check in the rpl_dio_print() function. ICMPv6: Use GET_IP6ADDR_STRING() in the rpl_dio_print() function. IPv6: Add some checks for the Hop-by-Hop Options header IPv6: Add a check for the Jumbo Payload Hop-by-Hop option. NFS: Fix the format for printing an unsigned int PTP: fix printing of the correction fields PTP: Use ND_LCHECK_U for checking invalid length. WHOIS: Add its own printer source file and printer function MPTCP: print length before subtype inside MPTCP options ESP: Add a workaround to a "use-of-uninitialized-value". PPP: Add tests to avoid incorrectly re-entering ppp_hdlc(). PPP: Don't process further if protocol is unknown (-e option). PPP: Change the pointer to packet data. ZEP: Add three length checks. Add some const qualifiers. Building and testing: Update config.guess and config.sub. Use AS_HELP_STRING macro instead of AC_HELP_STRING. Handle some Autoconf/make errors better. Fix an error when cross-compiling. Use "git archive" for the "make releasetar" process. Remove the release candidate rcX targets. Mend "make check" on Solaris 9 with Autoconf. Address assorted compiler warnings. Fix auto-enabling of Capsicum on FreeBSD with Autoconf. Treat "msys" as Windows for test exit statuses. Clean up some help messages in configure. Use unified diff by default. Remove awk code from mkdep. Fix configure test errors with Clang 15 CMake: Prevent stripping of the RPATH on installation. AppVeyor CI: update Npcap site, update to 1.12 SDK. Cirrus CI: Use the same configuration as for the main branch. CI: Add back running tcpdump -J/-L and capture, now with Cirrus VMs. Remove four test files (They are now in the libpcap tests directory). On Solaris, for 64-bit builds, use the 64-bit pcap-config. Tell CMake not to check for a C++ compiler. CMake: Add a way to request -Werror and equivalents. configure: Special-case macOS /usr/bin/pcap-config as we do in CMake. configure: Use pcap-config --static-pcap-only if available. configure: Use ac_c_werror_flag to force unknown compiler flags to fail. configure: Use AC_COMPILE_IFELSE() and AC_LANG_SOURCE() for testing flags. Run the test that fails on OpenBSD only if we're not on OpenBSD. Source code: Fix some snapend-changing routines to protect against pointer underflow. Use __func__ from C99 in some function calls. Memory allocator: Update nd_add_alloc_list() to a static function. addrtoname.c: Fix two invalid tests. Use more S_SUCCESS and S_ERR_HOST_PROGRAM in main(). Add some comments about "don't use GET_IP6ADDR_STRING()". Assign ndo->ndo_packetp in pretty_print_packet(). Add ND_LCHECKMSG_U, ND_LCHECK_U, ND_LCHECKMSG_ZU and ND_LCHECK_ZU macros. Update tok2strbuf() to a static function. netdissect.h: Keep the link-layer dissectors names sorted. setsignal(): Set SA_RESTART on non-lethal signals (REQ_INFO, FLUSH_PCAP) to avoid corrupting binary pcap output. Use __builtin_unreachable(). Fail if nd_push_buffer() or nd_push_snaplen() fails. Improve code style and fix many typos. Documentation: Some man page cleanups. Update the print interface for the packet count to stdout. Note that we require compilers to support at least some of C99. Update AIX and Solaris-related specifics. INSTALL.txt: Add doc/README.*, delete the deleted win32 directory. Update README.md and README.Win32.md. Update some comments with new RFC numbers. Wednesday, June 9, 2021 by gharris Summary for 4.99.1 tcpdump release Source code: Squelch some compiler warnings ICMP: Update the snapend for some nested IP packets. MACsec: Update the snapend thus the ICV field is not payload for the caller. EIGRP: Fix packet header fields SMB: Disable printer by default in CMake builds OLSR: Print the protocol name even if the packet is invalid MSDP: Print ": " before the protocol name ESP: Remove padding, padding length and next header from the buffer DHCPv6: Update the snapend for nested DHCPv6 packets OpenFlow 1.0: Get snapend right for nested frames. TCP: Update the snapend before decoding a MPTCP option Ethernet, IEEE 802.15.4, IP, L2TP, TCP, ZEP: Add bounds checks ForCES: Refine SPARSEDATA-TLV length check. ASCII/hex: Use nd_trunc_longjmp() in truncation cases GeoNet: Add a ND_TCHECK_LEN() call Replace ND_TCHECK_/memcpy() pairs with GET_CPY_BYTES(). BGP: Fix overwrites of global 'astostr' temporary buffer ARP: fix overwrites of static buffer in q922_string(). Frame Relay: have q922_string() handle errors better. Building and testing: Rebuild configure script when building release Fix "make clean" for out-of-tree autotools builds CMake: add stuff from CMAKE_PREFIX_PATH to PKG_CONFIG_PATH. Documentation: man: Update a reference as www.cifs.org is gone. [skip ci] man: Update DNS sections Solaris: Fix a compile error with Sun C Wednesday, December 30, 2020, by mcr@@sandelman.ca, denis and fxl. Summary for 4.99.0 tcpdump release CVE-2018-16301: For the -F option handle large input files safely. Improve the contents, wording and formatting of the man page. Print unsupported link-layer protocol packets in hex. Add support for new network protocols and DLTs: Arista, Autosar SOME/IP, Broadcom LI and Ethernet switches tag, IEEE 802.15.9, IP-over-InfiniBand (IPoIB), Linux SLL2, Linux vsockmon, MACsec, Marvell Distributed Switch Architecture, OpenFlow 1.3, Precision Time Protocol (PTP), SSH, WHOIS, ZigBee Encapsulation Protocol (ZEP). Make protocol-specific updates for: AH, DHCP, DNS, ESP, FRF.16, HNCP, ICMP6, IEEE 802.15.4, IPv6, IS-IS, Linux SLL, LLDP, LSP ping, MPTCP, NFS, NSH, NTP, OSPF, OSPF6, PGM, PIM, PPTP, RADIUS, RSVP, Rx, SMB, UDLD, VXLAN-GPE. User interface: Make SLL2 the default for Linux "any" pseudo-device. Add --micro and --nano shorthands. Add --count to print a counter only instead of decoding. Add --print, to cause packet printing even with -w. Add support for remote capture if libpcap supports it. Display the "wireless" flag and connection status. Flush the output packet buffer on a SIGUSR2. Add the snapshot length to the "reading from file ..." message. Fix local time printing (DST offset in timestamps). Allow -C arguments > 2^31-1 GB if they can fit into a long. Handle very large -f files by rejecting them. Report periodic stats only when safe to do so. Print the number of packets captured only as often as necessary. With no -s, or with -s 0, don't specify the snapshot length with newer versions of libpcap. Improve version and usage message printing. Building and testing: Install into bindir, not sbindir. autoconf: replace --with-system-libpcap with --disable-local-libpcap. Require the compiler to support C99. Better detect and use various C compilers and their features. Add CMake as the second build system. Make out-of-tree builds more reliable. Use pkg-config to detect libpcap if available. Improve Windows support. Add more tests and improve the scripts that run them. Test both with "normal" and "x87" floating-point. Eliminate dependency on libdnet. FreeBSD: Print a proper error message about monitor mode VAP. Use libcasper if available. Fix failure to capture on RDMA device. Include the correct capsicum header. Source code: Start the transition to longjmp() for packet truncation handling. Introduce new helper functions, including GET_*(), nd_print_protocol(), nd_print_invalid(), nd_print_trunc(), nd_trunc_longjmp() and others. Put integer signedness right in many cases. Introduce nd_uint*, nd_mac_addr, nd_ipv4 and nd_ipv6 types to fix alignment issues, especially on SPARC. Fix many C compiler, Coverity, UBSan and cppcheck warnings. Fix issues detected with AddressSanitizer. Remove many workarounds for older compilers and OSes. Add a sanity check on packet header length. Add and remove plenty of bounds checks. Clean up pcap_findalldevs() call to find the first interface. Use a short timeout, rather than immediate mode, for text output. Handle DLT_ENC files *not* written on the same OS and byte-order host. Add, and use, macros to do locale-independent case mapping. Use a table instead of getprotobynumber(). Get rid of ND_UNALIGNED and ND_TCHECK(). Make roundup2() generally available. Resync SMI list against Wireshark. Fix many typos. @ text @@ 1.1.1.2 log @Import tcpdump 4.99.6 (previous was 4.99.5) Tuesday, December 30, 2025 / The Tcpdump Group Summary for 4.99.6 tcpdump release Remove protocol decoding for: OTV (draft-hasmit-otv-04, this Internet-Draft is no longer active). Refine protocol decoding for: DNS: Use ND_TCHECK_LEN() instead of a custom bounds check. IPv6: Add a missing comma and remove a colon in the output. TCP: Note if the Urgent Pointer is non-zero while URG flag not set, if the verbose level is > 1 (option -vv and more). TCP: Note if the Acknowledgment Number is non-zero while ACK flag not set, if the verbose level is > 1 (option -vv and more). TCP: Fix Reset segment processing. IP, IPv6: Fix setting the snapshot length for the payload. IP: Use ND_TTEST_LEN() instead of a custom bounds check. frag6: Add a bounds check in non-verbose mode. PTP: Remove spaces before colons in output. PTP: Fix management packet fields. ISO: Avoid undefined behavior and integer overflow in the Fletcher checksum calculation. NFS: Delete dead code. BOOTP: Use an uint16_t variable to get the result of a GET_BE_U_2(). ZEP: use the existing NTP time formatting code. NTP: Fix p_ntp_time_fmt() using epoch 1/epoch 2 convention (RFC 4330). NTP: Update a field name with the RFC 5905 name (Origin Timestamp). IPv6 mobility: Modernize packet parsing and make fixes. IP6OPTS: Modernize packet parsing and make fixes. VXLAN: Add UDP port 8472 used by Linux as the default port. EGP: Replace custom code with tok2str(); Modernize packet parsing and fix printing with -v option. User interface: Add optional unit suffix on -C file size. Improve the handling of size suffixes for -C. Print errors for options -A, -x[x] and -X[X] (mutually exclusive). Print errors about -C, -G and -z options usage. For PCAP_ERROR_CAPTURE_NOTSUP, show the error message provided by libpcap for that error if it's non-empty. Update the -z option processing. Print "invalid option -- z" when it is. Add the -g option, causing IPv4 output in verbose mode to be on one line. Other: Avoid race condition when receiving signal during shutdown. Always show the interface name in error messages when the interface can't be opened. Clean up the message shown if a -i flag is specified with an interface index that's too large. Source code: Fix '-tt' option printing when time > 2106-02-07T06:28:15Z. Add sub-second packet timestamp checks for invalid micro/nano. Remove unused missing/snprintf.c. Fix incompatible pointer types with time functions calls on Windows. Use C99 macros to define 64-bit constants and maximum 64-bit values. Windows: Fixed to find wpcap.dll if WinPcap isn't installed and Npcap was installed without the WinPcap API compatibility option. (GitHub issue #1226). Building and testing: Makefile.in: Use a local libpcap in the releasecheck target. CMake: Fix build with CMake 3.31. autotools, CMake: don't separately test whether snprintf(3) is available and whether it's suitable - the test for whether it's suitable also fails if it's unavailable. CMake: Skip snprintf(3) tests when cross-compiling. autotools, CMake: fix issues with snprintf test and sanitizers. CMake: check whether check_c_source_runs() works, treat the build as a cross-compile if it doesn't work. Autoconf: Use AC_SYS_YEAR2038_RECOMMENDED when possible if the environment variable BUILD_YEAR2038 = yes (via autogen.sh). Autoconf: Avoid incorrectly include the libpcap's config.h. Autoconf: Refine reporting of os-proto.h. Require config.h to be from the tcpdump build. AppVeyor: Update Npcap SDK to 1.15. autogen.sh: Allow to configure Autoconf warnings. autogen.sh: Delete all trailing blank lines at end of configure. @ text @a63 36 # # We need to look for wpcap.dll in \Windows\System32\Npcap first, # as either: # # 1) WinPcap isn't installed and Npcap isn't installed in "WinPcap # API-compatible Mode", so there's no wpcap.dll in # \Windows\System32, only in \Windows\System32\Npcap; # # 2) WinPcap is installed and Npcap isn't installed in "WinPcap # API-compatible Mode", so the wpcap.dll in \Windows\System32 # is a WinPcap DLL, but we'd prefer an Npcap DLL (we should # work with either one if we're configured against WinPcap, # and we'll probably require Npcap if we're configured against # it), and that's in \Windows\System32\Npcap; # # 3) Npcap is installed in "WinPcap API-compatible Mode", so both # \Windows\System32 and \Windows\System32\Npcap have an Npcap # wpcap.dll. # # Unfortunately, Windows has no notion of an rpath, so we can't # set the rpath to include \Windows\System32\Npcap at link time; # what we need to do is to link wpcap as a delay-load DLL and # add \Windows\System32\Npcap to the DLL search path early in # main() with a call to SetDllDirectory(). # # We add /delayload:wpcap.dll to the linker options here. # # See https://npcap.com/guide/npcap-devguide.html#npcap-feature-native-dll-implicitly # set(PCAP_LINK_FLAGS /delayload:wpcap.dll) # # Delay-loading libraries means we need to link with delayimp.lib. # set(PCAP_LIBRARIES ${PCAP_LIBRARIES} delayimp.lib) @