From: Stuart Henderson Subject: ports libpcap? To: ports Date: Thu, 26 Feb 2026 17:45:37 +0000 I'd like to add an alternative version of libpcap to ports - similar to our handling of other libraries which exist in base + ports, with a non-default install path to avoid it getting picked up by accident. tar.gz for this attached. Any comments or OKs? Reasoning: - I'm trying to update Wireshark to the 4.6 branch which needs newer libpcap. (working diff for this inline below). - net/nmap already uses a bundled version of libpcap rather than the system one (we were never able to get to the bottom of timing problems). this could be replaced with this, which both makes it more easily identifiable, and gives it a chance of getting updated for fixes. - some other software has been a real challenge to work with base libpcap due to the differing directions that the two libraries took to handle timeval issues (everything touching timevals in the relevant program needs analysing to decide whether they're an actual timeval or a bpf_timeval, with conversion routines added where needed; this results in some of this fairly sensitive software being stuck at an old version because it's too painful to go through this again). ----- Index: Makefile =================================================================== RCS file: /cvs/ports/net/wireshark/Makefile,v diff -u -p -r1.176 Makefile --- Makefile 26 Feb 2026 10:21:38 -0000 1.176 +++ Makefile 26 Feb 2026 17:44:37 -0000 @@ -4,19 +4,15 @@ COMMENT-main = graphical network protoco COMMENT-text = network protocol analyzer DPB_PROPERTIES = parallel -V = 4.4.14 -PORTROACH = limit:^4\.4\. -#PORTROACH = limitw:1,even # 4.6 needs newer libpcap +V = 4.6.4 +PORTROACH = limitw:1,even DISTNAME = wireshark-$V PKGNAME-main = wireshark-$V PKGNAME-text = tshark-$V -# keep above 7.8-stable -REVISION = 0 - -SHARED_LIBS += wsutil 4.0 -SHARED_LIBS += wiretap 4.0 -SHARED_LIBS += wireshark 4.0 +SHARED_LIBS += wsutil 5.0 +SHARED_LIBS += wiretap 5.0 +SHARED_LIBS += wireshark 5.0 CATEGORIES = net security x11 Index: distinfo =================================================================== RCS file: /cvs/ports/net/wireshark/distinfo,v diff -u -p -r1.110 distinfo --- distinfo 26 Feb 2026 10:21:38 -0000 1.110 +++ distinfo 26 Feb 2026 17:44:37 -0000 @@ -1,2 +1,2 @@ -SHA256 (wireshark-4.4.14.tar.xz) = yRExML0rN5Gf3PV19xBGnOORlguq/zGRHjKIRp5qjo0= -SIZE (wireshark-4.4.14.tar.xz) = 46874836 +SHA256 (wireshark-4.6.4.tar.xz) = ++qz2FxsildjyNm3/iC1xpyp+efyuCS+3HMTW9yjMuI= +SIZE (wireshark-4.6.4.tar.xz) = 50566640 Index: patches/patch-CMakeLists_txt =================================================================== RCS file: patches/patch-CMakeLists_txt diff -N patches/patch-CMakeLists_txt --- patches/patch-CMakeLists_txt 20 Feb 2025 16:09:51 -0000 1.24 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,16 +0,0 @@ -Avoid the broken libwsutil.so that gets generated with -pie -shared -(probably following tools/clang/lib/Driver/Tools.cpp r1.13 "push back --pie to the linker if -pie is specified"). - -Index: CMakeLists.txt ---- CMakeLists.txt.orig -+++ CMakeLists.txt -@@ -1173,7 +1173,7 @@ endif() - - include(CheckCLinkerFlag) - --if(NOT CMAKE_C_COMPILER_ID MATCHES "MSVC" AND NOT OSS_FUZZ) -+if(NOT CMAKE_C_COMPILER_ID MATCHES "MSVC" AND NOT OSS_FUZZ AND NOT CMAKE_SYSTEM_NAME STREQUAL OpenBSD) - # - # The -pie linker option produces a position-independent executable. - # Some Linux distributions have this enabled by default in the compiler, Index: patches/patch-capture_capture-pcap-util_c =================================================================== RCS file: /cvs/ports/net/wireshark/patches/patch-capture_capture-pcap-util_c,v diff -u -p -r1.6 patch-capture_capture-pcap-util_c --- patches/patch-capture_capture-pcap-util_c 29 Aug 2024 08:12:27 -0000 1.6 +++ patches/patch-capture_capture-pcap-util_c 26 Feb 2026 17:44:37 -0000 @@ -17,14 +17,14 @@ Index: capture/capture-pcap-util.c /* @@ -44,8 +46,6 @@ */ - #if defined(HAVE_PCAP_CREATE) && defined(__linux__) + #if defined(__linux__) -#include - /* * If we're building for a Linux version that supports bonding, * HAVE_BONDING will be defined. -@@ -817,6 +817,23 @@ get_interface_list_findalldevs(int *err, char **err_st +@@ -816,6 +816,23 @@ get_interface_list_findalldevs(int *err, char **err_st if_info_ip(if_info, dev); } pcap_freealldevs(alldevs); Index: patches/patch-cmake_modules_FindPCAP_cmake =================================================================== RCS file: patches/patch-cmake_modules_FindPCAP_cmake diff -N patches/patch-cmake_modules_FindPCAP_cmake --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-cmake_modules_FindPCAP_cmake 26 Feb 2026 17:44:37 -0000 @@ -0,0 +1,33 @@ +- use ports libpcap + +Index: cmake/modules/FindPCAP.cmake +--- cmake/modules/FindPCAP.cmake.orig ++++ cmake/modules/FindPCAP.cmake +@@ -14,7 +14,7 @@ FindWSWinLibs("libpcap-*" "PCAP_HINTS") + # + if(NOT USE_REPOSITORY) + find_package(PkgConfig) +- pkg_search_module(PC_PCAP libpcap) ++ pkg_search_module(PC_PCAP libepcap) + endif() + + if(NOT PC_PCAP_FOUND AND NOT WIN32) +@@ -135,17 +135,7 @@ if (WIN32 AND (CMAKE_CROSSCOMPILING OR USE_MSYSTEM)) + #VALIDATOR pcap_include_check + ) + else() +- find_path(PCAP_INCLUDE_DIR +- NAMES +- pcap/pcap.h +- HINTS +- ${PC_PCAP_INCLUDE_DIRS} +- ${PCAP_CONFIG_INCLUDE_DIRS} +- "${PCAP_HINTS}/Include" +- PATHS +- "${CMAKE_SOURCE_DIR}/libpcap" +- #VALIDATOR pcap_include_check +- ) ++ set(PCAP_INCLUDE_DIR ${PC_PCAP_INCLUDE_DIRS}) + endif() + + # On Windows we load wpcap.dll explicitly and probe its functions in Index: patches/patch-tools_radiotap-gen_CMakeLists_txt =================================================================== RCS file: patches/patch-tools_radiotap-gen_CMakeLists_txt diff -N patches/patch-tools_radiotap-gen_CMakeLists_txt --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-tools_radiotap-gen_CMakeLists_txt 26 Feb 2026 17:44:37 -0000 @@ -0,0 +1,10 @@ +Index: tools/radiotap-gen/CMakeLists.txt +--- tools/radiotap-gen/CMakeLists.txt.orig ++++ tools/radiotap-gen/CMakeLists.txt +@@ -4,5 +4,6 @@ if(UNIX) + add_executable( radiotap-gen radiotap-gen.c ) + + target_link_libraries( radiotap-gen pcap ${GLIB2_LIBRARIES} ) ++ target_include_directories( radiotap-gen SYSTEM PRIVATE ${PCAP_INCLUDE_DIRS} ) + + endif() Index: patches/patch-tools_radiotap-gen_radiotap-gen_c =================================================================== RCS file: patches/patch-tools_radiotap-gen_radiotap-gen_c diff -N patches/patch-tools_radiotap-gen_radiotap-gen_c --- patches/patch-tools_radiotap-gen_radiotap-gen_c 5 Oct 2022 13:58:00 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -Index: tools/radiotap-gen/radiotap-gen.c ---- tools/radiotap-gen/radiotap-gen.c.orig -+++ tools/radiotap-gen/radiotap-gen.c -@@ -66,7 +66,7 @@ static void gen_u_sig_pkts(pcap_dumper_t *dumper) - { - struct pcap_pkthdr hdr; - struct complete_pkt pkt; -- struct timeval ts; -+ struct bpf_timeval ts; - /* - * Create the complete packet. - * Index: pkg/PLIST-text =================================================================== RCS file: /cvs/ports/net/wireshark/pkg/PLIST-text,v diff -u -p -r1.21 PLIST-text --- pkg/PLIST-text 29 Aug 2024 08:12:27 -0000 1.21 +++ pkg/PLIST-text 26 Feb 2026 17:44:37 -0000 @@ -7,7 +7,6 @@ @mode @group @bin bin/editcap -@bin bin/idl2wrs @bin bin/mergecap @bin bin/mmdbresolve @bin bin/randpkt @@ -20,13 +19,6 @@ @lib lib/libwiretap.so.${LIBwiretap_VERSION} @lib lib/libwsutil.so.${LIBwsutil_VERSION} lib/wireshark/ -lib/wireshark/extcap/ -@bin lib/wireshark/extcap/androiddump -@bin lib/wireshark/extcap/ciscodump -@bin lib/wireshark/extcap/randpktdump -@bin lib/wireshark/extcap/sshdump -@bin lib/wireshark/extcap/udpdump -@bin lib/wireshark/extcap/wifidump lib/wireshark/plugins/ lib/wireshark/plugins/${WVER}/ lib/wireshark/plugins/${WVER}/codecs/ @@ -53,6 +45,14 @@ lib/wireshark/plugins/${WVER}/epan/ @so lib/wireshark/plugins/${WVER}/epan/wimaxmacphy.so lib/wireshark/plugins/${WVER}/wiretap/ @so lib/wireshark/plugins/${WVER}/wiretap/usbdump.so +libexec/wireshark/ +libexec/wireshark/extcap/ +@bin libexec/wireshark/extcap/androiddump +@bin libexec/wireshark/extcap/ciscodump +@bin libexec/wireshark/extcap/randpktdump +@bin libexec/wireshark/extcap/sshdump +@bin libexec/wireshark/extcap/udpdump +@bin libexec/wireshark/extcap/wifidump @man man/man1/androiddump.1 @man man/man1/capinfos.1 @man man/man1/captype.1 @@ -67,7 +67,10 @@ lib/wireshark/plugins/${WVER}/wiretap/ @man man/man1/randpktdump.1 @man man/man1/rawshark.1 @man man/man1/reordercap.1 +@man man/man1/sshdig.1 @man man/man1/sshdump.1 +@man man/man1/strato.1 +@man man/man1/stratoshark.1 @man man/man1/text2pcap.1 @man man/man1/tshark.1 @man man/man1/udpdump.1 @@ -77,6 +80,8 @@ lib/wireshark/plugins/${WVER}/wiretap/ share/doc/wireshark/ share/doc/wireshark/COPYING share/doc/wireshark/README.xml-output +share/doc/wireshark/Stratoshark Release Notes.html +share/doc/wireshark/Wireshark Release Notes.html share/doc/wireshark/androiddump.html share/doc/wireshark/capinfos.html share/doc/wireshark/captype.html @@ -92,9 +97,11 @@ share/doc/wireshark/pdml2html.xsl share/doc/wireshark/randpkt.html share/doc/wireshark/randpktdump.html share/doc/wireshark/rawshark.html -share/doc/wireshark/release-notes.html share/doc/wireshark/reordercap.html +share/doc/wireshark/sshdig.html share/doc/wireshark/sshdump.html +share/doc/wireshark/strato.html +share/doc/wireshark/stratoshark.html share/doc/wireshark/text2pcap.html share/doc/wireshark/tshark.html share/doc/wireshark/udpdump.html @@ -110,7 +117,6 @@ share/wireshark/diameter/ share/wireshark/diameter/AlcatelLucent.xml share/wireshark/diameter/Cisco.xml share/wireshark/diameter/CiscoSystems.xml -share/wireshark/diameter/Custom.xml share/wireshark/diameter/Ericsson.xml share/wireshark/diameter/HP.xml share/wireshark/diameter/Huawei.xml @@ -131,6 +137,7 @@ share/wireshark/diameter/VerizonWireless share/wireshark/diameter/Vodafone.xml share/wireshark/diameter/chargecontrol.xml share/wireshark/diameter/dictionary.dtd +share/wireshark/diameter/dictionary.ent share/wireshark/diameter/dictionary.xml share/wireshark/diameter/eap.xml share/wireshark/diameter/etsie2e4.xml @@ -195,6 +202,7 @@ share/wireshark/radius/dictionary.arista share/wireshark/radius/dictionary.aruba share/wireshark/radius/dictionary.ascend share/wireshark/radius/dictionary.ascend.illegal +share/wireshark/radius/dictionary.ascend.illegal.extended share/wireshark/radius/dictionary.asn share/wireshark/radius/dictionary.audiocodes share/wireshark/radius/dictionary.avaya @@ -272,6 +280,7 @@ share/wireshark/radius/dictionary.iea share/wireshark/radius/dictionary.infinera share/wireshark/radius/dictionary.infoblox share/wireshark/radius/dictionary.infonet +share/wireshark/radius/dictionary.ingate share/wireshark/radius/dictionary.ipunplugged share/wireshark/radius/dictionary.issanni share/wireshark/radius/dictionary.itk