libpcap: update to 1.10.0
authorRosen Penev <rosenp@gmail.com>
Mon, 4 Jan 2021 23:46:42 +0000 (15:46 -0800)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 28 Feb 2021 23:34:23 +0000 (00:34 +0100)
Simplify cmake option handling by putting everything in blocks.

Add openssl patch as there's no easy way to disable.

Rebase the skip manpages patch.

Remove the monitor mode patch as it no longer applies.

Remove flex patch as normal Makefile is no longer used.

Remove USB path patch. While it is deprecated, the codepath is never
taken. /sys/bus/usb/devices is checked before hand. If it exists, the
function does stuff and returns. Additionally, this path is used
elsewhere in the code.

Refresh other patches.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
package/libs/libpcap/Makefile
package/libs/libpcap/patches/100-no-openssl.patch [new file with mode: 0644]
package/libs/libpcap/patches/102-skip-manpages.patch
package/libs/libpcap/patches/103-makefile_flex_workaround.patch [deleted file]
package/libs/libpcap/patches/201-space_optimization.patch
package/libs/libpcap/patches/203-undef_iw_mode_monitor.patch [deleted file]
package/libs/libpcap/patches/204-usb-bus-path.patch [deleted file]

index 35ceb18c29a4c6168b059eadc637fa3f90632193..6168d4c45944b9a3f917153721f427df1b1c6b9c 100644 (file)
@@ -8,22 +8,21 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libpcap
-PKG_VERSION:=1.9.1
-PKG_RELEASE:=3
+PKG_VERSION:=1.10.0
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.us.tcpdump.org/release/ \
         http://www.tcpdump.org/release/
-PKG_HASH:=635237637c5b619bcceba91900666b64d56ecb7be63f298f601ec786ce087094
+PKG_HASH:=8d12b42623eeefee872f123bd0dc85d535b00df4d42e865f993c40f7bfc92b1e
 
 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=LICENSE
 
 PKG_ASLR_PIE_REGULAR:=1
 PKG_BUILD_PARALLEL:=1
 
-PKG_LICENSE:=BSD-3-Clause
-PKG_LICENSE_FILES:=LICENSE
-
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/cmake.mk
 
@@ -48,11 +47,16 @@ endef
 CMAKE_OPTIONS += \
        -DBUILD_SHARED_LIBS=ON \
        -DBUILD_WITH_LIBNL=OFF \
+       -DINET6=O$(if $(CONFIG_IPV6),N,FF) \
+       -DPCAP_SUPPORT_NETFILTER=O$(if $(CONFIG_PCAP_HAS_NETFILTER),N,FF)
 
 # grep 'option(DISABLE_' CMakeLists.txt | cut -f2 -d'(' | cut -f1 -d' ' | sort --unique
 CMAKE_OPTIONS += \
+       -DDISABLE_BLUETOOTH=O$(if $(CONFIG_PCAP_HAS_BT),FF,N) \
        -DDISABLE_DAG=ON \
        -DDISABLE_DBUS=ON \
+       -DDISABLE_DPDK=ON \
+       -DDISABLE_LINUX_USBMON=O$(if $(CONFIG_PCAP_HAS_USB),FF,N) \
        -DDISABLE_NETMAP=ON \
        -DDISABLE_RDMA=ON \
        -DDISABLE_SEPTEL=ON \
@@ -64,12 +68,6 @@ CMAKE_OPTIONS += \
        -DBDEBUG=OFF \
        -DYYDEBUG=OFF \
 
-CMAKE_OPTIONS += $(if $(CONFIG_PCAP_HAS_USB)       ,,-DDISABLE_USB=ON)
-CMAKE_OPTIONS += $(if $(CONFIG_PCAP_HAS_BT)        ,,-DDISABLE_BLUETOOTH=ON)
-CMAKE_OPTIONS += $(if $(CONFIG_PCAP_HAS_NETFILTER) ,,-DPCAP_SUPPORT_NETFILTER=OFF)
-
-CMAKE_OPTIONS += $(if $(CONFIG_IPV6),-DINET6=ON,-DINET6=OFF)
-
 define Build/InstallDev
        $(call Build/InstallDev/cmake,$(1))
        $(SED) \
diff --git a/package/libs/libpcap/patches/100-no-openssl.patch b/package/libs/libpcap/patches/100-no-openssl.patch
new file mode 100644 (file)
index 0000000..6424cf8
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1006,7 +1006,6 @@ endif()
+ #
+ # OpenSSL/libressl.
+ #
+-find_package(OpenSSL)
+ if(OPENSSL_FOUND)
+   #
+   # We have OpenSSL.
index 28f572c913dab21039d7bffcf4fbc9f40b450966..57b780c1fee2eab9c9156cad8533bb7e4802e7cc 100644 (file)
@@ -7,69 +7,63 @@ Subject: [PATCH] skip manpages
  CMakeLists.txt | 55 --------------------------------------------------
  1 file changed, 55 deletions(-)
 
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 55b93f14..acf1a904 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -2397,61 +2397,6 @@ if(NOT MSVC)
-     configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpcap.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libpcap.pc @ONLY)
-     install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/pcap-config DESTINATION bin)
-     install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpcap.pc DESTINATION lib/pkgconfig)
+@@ -2701,57 +2701,6 @@ if(NOT MSVC)
+     if(MINGW)
+         find_program(LINK_EXECUTABLE ln)
+     endif(MINGW)
+-    if(UNIX OR (MINGW AND LINK_EXECUTABLE))
+-        set(MAN1 "")
+-        foreach(MANPAGE ${MAN1_NOEXPAND})
+-            set(MAN1 ${MAN1} ${CMAKE_CURRENT_SOURCE_DIR}/${MANPAGE})
+-        endforeach(MANPAGE)
+-        install(FILES ${MAN1} DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
 -
--    #
--    # Man pages.
--    #
--    # For each section of the manual for which we have man pages
--    # that require macro expansion, do the expansion.
--    #
--    set(MAN1 "")
--    foreach(MANPAGE ${MAN1_NOEXPAND})
--        set(MAN1 ${MAN1} ${CMAKE_CURRENT_SOURCE_DIR}/${MANPAGE})
--    endforeach(MANPAGE)
--    install(FILES ${MAN1} DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
+-        set(MAN3PCAP "")
+-        foreach(MANPAGE ${MAN3PCAP_NOEXPAND})
+-            set(MAN3PCAP ${MAN3PCAP} ${CMAKE_CURRENT_SOURCE_DIR}/${MANPAGE})
+-        endforeach(MANPAGE)
+-        foreach(TEMPLATE_MANPAGE ${MAN3PCAP_EXPAND})
+-            string(REPLACE ".in" "" MANPAGE ${TEMPLATE_MANPAGE})
+-            configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${TEMPLATE_MANPAGE} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE} @ONLY)
+-            set(MAN3PCAP ${MAN3PCAP} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE})
+-        endforeach(TEMPLATE_MANPAGE)
+-        install(FILES ${MAN3PCAP} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3)
+-        install_manpage_symlink(pcap_datalink_val_to_name.3pcap pcap_datalink_val_to_description.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
+-        install_manpage_symlink(pcap_datalink_val_to_name.3pcap pcap_datalink_val_to_description_or_dlt.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
+-        install_manpage_symlink(pcap_dump_open.3pcap pcap_dump_fopen.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
+-        install_manpage_symlink(pcap_findalldevs.3pcap pcap_freealldevs.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
+-        install_manpage_symlink(pcap_geterr.3pcap pcap_perror.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
+-        install_manpage_symlink(pcap_inject.3pcap pcap_sendpacket.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
+-        install_manpage_symlink(pcap_list_datalinks.3pcap pcap_free_datalinks.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
+-        install_manpage_symlink(pcap_list_tstamp_types.3pcap pcap_free_tstamp_types.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
+-        install_manpage_symlink(pcap_loop.3pcap pcap_dispatch.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
+-        install_manpage_symlink(pcap_major_version.3pcap pcap_minor_version.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
+-        install_manpage_symlink(pcap_next_ex.3pcap pcap_next.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
+-        install_manpage_symlink(pcap_open_dead.3pcap pcap_open_dead_with_tstamp_precision.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
+-        install_manpage_symlink(pcap_open_offline.3pcap pcap_open_offline_with_tstamp_precision.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
+-        install_manpage_symlink(pcap_open_offline.3pcap pcap_fopen_offline.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
+-        install_manpage_symlink(pcap_open_offline.3pcap pcap_fopen_offline_with_tstamp_precision.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
+-        install_manpage_symlink(pcap_tstamp_type_val_to_name.3pcap pcap_tstamp_type_val_to_description.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
+-        install_manpage_symlink(pcap_setnonblock.3pcap pcap_getnonblock.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
 -
--    set(MAN3PCAP "")
--    foreach(MANPAGE ${MAN3PCAP_NOEXPAND})
--        set(MAN3PCAP ${MAN3PCAP} ${CMAKE_CURRENT_SOURCE_DIR}/${MANPAGE})
--    endforeach(MANPAGE)
--    foreach(TEMPLATE_MANPAGE ${MAN3PCAP_EXPAND})
--        string(REPLACE ".in" "" MANPAGE ${TEMPLATE_MANPAGE})
--        configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${TEMPLATE_MANPAGE} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE} @ONLY)
--        set(MAN3PCAP ${MAN3PCAP} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE})
--    endforeach(TEMPLATE_MANPAGE)
--    install(FILES ${MAN3PCAP} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3)
--    install_manpage_symlink(pcap_datalink_val_to_name.3pcap pcap_datalink_val_to_description.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
--    install_manpage_symlink(pcap_dump_open.3pcap pcap_dump_fopen.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
--    install_manpage_symlink(pcap_findalldevs.3pcap pcap_freealldevs.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
--    install_manpage_symlink(pcap_geterr.3pcap pcap_perror.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
--    install_manpage_symlink(pcap_inject.3pcap pcap_sendpacket.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
--    install_manpage_symlink(pcap_list_datalinks.3pcap pcap_free_datalinks.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
--    install_manpage_symlink(pcap_list_tstamp_types.3pcap pcap_free_tstamp_types.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
--    install_manpage_symlink(pcap_loop.3pcap pcap_dispatch.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
--    install_manpage_symlink(pcap_major_version.3pcap pcap_minor_version.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
--    install_manpage_symlink(pcap_next_ex.3pcap pcap_next.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
--    install_manpage_symlink(pcap_open_dead.3pcap pcap_open_dead_with_tstamp_precision.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
--    install_manpage_symlink(pcap_open_offline.3pcap pcap_open_offline_with_tstamp_precision.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
--    install_manpage_symlink(pcap_open_offline.3pcap pcap_fopen_offline.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
--    install_manpage_symlink(pcap_open_offline.3pcap pcap_fopen_offline_with_tstamp_precision.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
--    install_manpage_symlink(pcap_tstamp_type_val_to_name.3pcap pcap_tstamp_type_val_to_description.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
--    install_manpage_symlink(pcap_setnonblock.3pcap pcap_getnonblock.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
+-        set(MANFILE "")
+-        foreach(TEMPLATE_MANPAGE ${MANFILE_EXPAND})
+-            string(REPLACE ".manfile.in" ".${MAN_FILE_FORMATS}" MANPAGE ${TEMPLATE_MANPAGE})
+-            configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${TEMPLATE_MANPAGE} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE} @ONLY)
+-            set(MANFILE ${MANFILE} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE})
+-        endforeach(TEMPLATE_MANPAGE)
+-        install(FILES ${MANFILE} DESTINATION ${CMAKE_INSTALL_MANDIR}/man${MAN_FILE_FORMATS})
 -
--    set(MANFILE "")
--    foreach(TEMPLATE_MANPAGE ${MANFILE_EXPAND})
--        string(REPLACE ".manfile.in" ".${MAN_FILE_FORMATS}" MANPAGE ${TEMPLATE_MANPAGE})
--        configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${TEMPLATE_MANPAGE} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE} @ONLY)
--        set(MANFILE ${MANFILE} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE})
--    endforeach(TEMPLATE_MANPAGE)
--    install(FILES ${MANFILE} DESTINATION ${CMAKE_INSTALL_MANDIR}/man${MAN_FILE_FORMATS})
--
--    set(MANMISC "")
--    foreach(TEMPLATE_MANPAGE ${MANMISC_EXPAND})
--        string(REPLACE ".manmisc.in" ".${MAN_MISC_INFO}" MANPAGE ${TEMPLATE_MANPAGE})
--        configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${TEMPLATE_MANPAGE} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE} @ONLY)
--        set(MANMISC ${MANMISC} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE})
--    endforeach(TEMPLATE_MANPAGE)
--    install(FILES ${MANMISC} DESTINATION ${CMAKE_INSTALL_MANDIR}/man${MAN_MISC_INFO})
+-        set(MANMISC "")
+-        foreach(TEMPLATE_MANPAGE ${MANMISC_EXPAND})
+-            string(REPLACE ".manmisc.in" ".${MAN_MISC_INFO}" MANPAGE ${TEMPLATE_MANPAGE})
+-            configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${TEMPLATE_MANPAGE} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE} @ONLY)
+-            set(MANMISC ${MANMISC} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE})
+-        endforeach(TEMPLATE_MANPAGE)
+-        install(FILES ${MANMISC} DESTINATION ${CMAKE_INSTALL_MANDIR}/man${MAN_MISC_INFO})
+-    endif(UNIX OR (MINGW AND LINK_EXECUTABLE))
  endif(NOT MSVC)
  
  # uninstall target
diff --git a/package/libs/libpcap/patches/103-makefile_flex_workaround.patch b/package/libs/libpcap/patches/103-makefile_flex_workaround.patch
deleted file mode 100644 (file)
index 93e07c6..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-
-       Copyright (C) 2006 Markus Wigge
-
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -59,7 +59,7 @@ MKDEP = @MKDEP@
- CCOPT = @V_CCOPT@
- SHLIB_CCOPT = @V_SHLIB_CCOPT@
- INCLS = -I. @V_INCLS@
--DEFS = -DBUILDING_PCAP -Dpcap_EXPORTS @DEFS@ @V_DEFS@
-+DEFS = -DBUILDING_PCAP -D_BSD_SOURCE -Dpcap_EXPORTS @DEFS@ @V_DEFS@
- ADDLOBJS = @ADDLOBJS@
- ADDLARCHIVEOBJS = @ADDLARCHIVEOBJS@
- LIBS = @LIBS@
index 80e3824d825e02e92d736aaee2e8c23e4d011db9..bf9374dd542b3d9f83b75b8af151e731702b5019 100644 (file)
@@ -1,6 +1,6 @@
 --- a/pcap-common.c
 +++ b/pcap-common.c
-@@ -1570,14 +1570,23 @@ swap_pseudo_headers(int linktype, struct
+@@ -1662,14 +1662,23 @@ swap_pseudo_headers(int linktype, struct
                break;
  
        case DLT_USB_LINUX:
diff --git a/package/libs/libpcap/patches/203-undef_iw_mode_monitor.patch b/package/libs/libpcap/patches/203-undef_iw_mode_monitor.patch
deleted file mode 100644 (file)
index 53dd501..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/pcap-linux.c
-+++ b/pcap-linux.c
-@@ -263,6 +263,8 @@
- typedef int           socklen_t;
- #endif
-+#undef IW_MODE_MONITOR
-+
- #ifndef MSG_TRUNC
- /*
-  * This is being compiled on a system that lacks MSG_TRUNC; define it
diff --git a/package/libs/libpcap/patches/204-usb-bus-path.patch b/package/libs/libpcap/patches/204-usb-bus-path.patch
deleted file mode 100644 (file)
index 0c967a0..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-Fix USB bus path; /proc/bus/usb is deprecated.
-
---- a/pcap-usb-linux.c
-+++ b/pcap-usb-linux.c
-@@ -73,7 +73,7 @@
- #define USB_TEXT_DIR_OLD "/sys/kernel/debug/usbmon"
- #define USB_TEXT_DIR "/sys/kernel/debug/usb/usbmon"
- #define SYS_USB_BUS_DIR "/sys/bus/usb/devices"
--#define PROC_USB_BUS_DIR "/proc/bus/usb"
-+#define PROC_USB_BUS_DIR "/dev/bus/usb"
- #define USB_LINE_LEN 4096
- #if __BYTE_ORDER == __LITTLE_ENDIAN