From 5c04efd2d7d9432f75843c3fd472458ad37d203d Mon Sep 17 00:00:00 2001 From: Sven Wegener Date: Thu, 17 Dec 2015 11:59:24 +0100 Subject: [PATCH 01/36] toolchain: fix dangling symlink to self in FixupLibdir This avoids a dangling symlink to self when reinstalling the toolchain: ./staging_dir/toolchain-mips_24kc_gcc-9.3.0_musl/lib/lib -> lib This is caused by the fact that in the toolchain dir we have 'lib64 -> lib' and on executing 'ln lib ./staging_dir/toolchain-mips_24kc_gcc-9.3.0_musl/lib64' ln dereference the symbolic link 'lib64' to 'lib' so the REAL command is 'ln lib ./staging_dir/toolchain-mips_24kc_gcc-9.3.0_musl/lib' this results in the dangling symlink to self. Signed-off-by: Sven Wegener [ add more details to the commit description and fix title ] Signed-off-by: Christian Marangi --- include/toolchain-build.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/toolchain-build.mk b/include/toolchain-build.mk index b7a253b71b..87ba8313df 100644 --- a/include/toolchain-build.mk +++ b/include/toolchain-build.mk @@ -18,6 +18,6 @@ define FixupLibdir mkdir -p $(1)/lib; \ mv $(1)/lib64/* $(1)/lib/; \ rm -rf $(1)/lib64; \ + ln -sf lib $(1)/lib64; \ fi - ln -sf lib $(1)/lib64 endef From a0e1d3ab7b4ff06cf755884329e0742b1582badd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibaut=20VAR=C3=88NE?= Date: Thu, 30 Jun 2022 10:06:35 +0200 Subject: [PATCH 02/36] ramips: improve YunCore AX820 LEDs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At least two AX820 hardware variants are known to exist, but they cannot be distinguished (same hardware revision, no specific markings). They appear to have the same LED hardware, but wired differently: - One has a red system LED at GPIO 15, a green wlan2g LED at GPIO 14 and a blue wlan5g LED at GPIO 16; - The other only offers a green system LED at GPIO 15, with GPIO 14 and 16 being apparently not connected Finally, a Yuncore datasheet says the canonical wiring should be: - Blue wlan2g GPIO 14, green system GPIO 15, red wlan5g GPIO 16 All GPIOs are tied to a single RGB LED which is exposed via lightpipe on the device front casing. Considering the above, this patch exposes all three LEDs, preserves the common system LED (GPIO 15) as the openwrt status LED, and removes the color information from the LEDs names since it is not consistent across hardware. The LED naming is made consistent with other YunCore devices. A note is added in DTS to ensure this information is always available and prevent unwanted changes in the future. Fixes: #10131 "YunCore AX820: GPIO LED not correct" Reviewed-by: Sander Vanheule Signed-off-by: Thibaut VARÈNE --- .../linux/ramips/dts/mt7621_yuncore_ax820.dts | 32 +++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/target/linux/ramips/dts/mt7621_yuncore_ax820.dts b/target/linux/ramips/dts/mt7621_yuncore_ax820.dts index fe0e9daf7f..9638f1f060 100644 --- a/target/linux/ramips/dts/mt7621_yuncore_ax820.dts +++ b/target/linux/ramips/dts/mt7621_yuncore_ax820.dts @@ -10,10 +10,10 @@ model = "YunCore AX820"; aliases { - led-boot = &led_status_green; - led-failsafe = &led_status_green; - led-running = &led_status_green; - led-upgrade = &led_status_green; + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; }; chosen { @@ -23,10 +23,30 @@ leds { compatible = "gpio-leds"; - led_status_green: status_green { - label = "green:status"; + /* At least 2 AX820 variants are known and cannot be distinguished (same hw rev): + - System LED green GPIO 15; red and blue apparently not connected + - System LED red GPIO 15, WLAN2G LED green GPIO 14, WLAN5G LED blue GPIO 16 + The canonical values taken from a Yuncore datasheet are: + - System LED green GPIO 15, WLAN2G LED blue GPIO 14, WLAN5G LED red GPIO 16 + All 3 colors relate to the same single RGB LED showing up on the front lightpipe. + As a result, all 3 LEDs are defined even if only one may be available, and + the color information is absent as it is not reliable */ + wlan2g { + label = "wlan2g"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0radio"; + }; + + led_system: system { + label = "system"; gpios = <&gpio 15 GPIO_ACTIVE_LOW>; }; + + wlan5g { + label = "wlan5g"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1radio"; + }; }; watchdog { From 1b14e25d2e884fe4dce239f8bc6ac68ee702b4a8 Mon Sep 17 00:00:00 2001 From: Luiz Angelo Daros de Luca Date: Tue, 26 Apr 2022 18:50:08 -0300 Subject: [PATCH 03/36] kernel: netdevices: load rtl8366rb on boot This external switch driver should be loaded on boot for network support in failsafe mode. Signed-off-by: Luiz Angelo Daros de Luca --- package/kernel/linux/modules/netdevices.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index ff5284276c..7b8e808e6d 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -373,7 +373,7 @@ define KernelPackage/switch-rtl8366rb DEPENDS:=+kmod-switch-rtl8366-smi KCONFIG:=CONFIG_RTL8366RB_PHY FILES:=$(LINUX_DIR)/drivers/net/phy/rtl8366rb.ko - AUTOLOAD:=$(call AutoLoad,43,rtl8366rb) + AUTOLOAD:=$(call AutoLoad,43,rtl8366rb,1) endef define KernelPackage/switch-rtl8366rb/description From 575ec7a4b1a085f243961ef13dd23f228a60e67e Mon Sep 17 00:00:00 2001 From: Luiz Angelo Daros de Luca Date: Tue, 26 Apr 2022 18:51:32 -0300 Subject: [PATCH 04/36] ath79: use rtl8366rb as a module It looks like rtl8366rb is used only by tplink_tl-wr1043nd-v1 and buffalo_wzr-hp-g300nh-rb. There is no need to have it built-in as it works as a loadable module. Tested both failsafe and normal boot on tl-wr1043nd-v1. buffalo_wzr-hp-g300nh-rb was not tested. Signed-off-by: Luiz Angelo Daros de Luca --- target/linux/ath79/generic/config-default | 1 - target/linux/ath79/image/generic-tp-link.mk | 2 +- target/linux/ath79/image/generic.mk | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/ath79/generic/config-default b/target/linux/ath79/generic/config-default index f160cc8d07..bc619cd9b8 100644 --- a/target/linux/ath79/generic/config-default +++ b/target/linux/ath79/generic/config-default @@ -19,7 +19,6 @@ CONFIG_PHY_AR7100_USB=y CONFIG_PHY_AR7200_USB=y CONFIG_REALTEK_PHY=y CONFIG_REGULATOR_FIXED_VOLTAGE=y -CONFIG_RTL8366RB_PHY=y CONFIG_RTL8366S_PHY=y CONFIG_RTL8366_SMI=y CONFIG_RTL8367_PHY=y diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk index 6d9ba2cd40..21cbade7cc 100644 --- a/target/linux/ath79/image/generic-tp-link.mk +++ b/target/linux/ath79/image/generic-tp-link.mk @@ -682,7 +682,7 @@ define Device/tplink_tl-wr1043nd-v1 SOC := ar9132 DEVICE_MODEL := TL-WR1043N/ND DEVICE_VARIANT := v1 - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-switch-rtl8366rb TPLINK_HWID := 0x10430001 SUPPORTED_DEVICES += tl-wr1043nd endef diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 8d059f3679..4cc89a4b97 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -581,6 +581,7 @@ TARGET_DEVICES += buffalo_wzr-hp-g300nh-rb define Device/buffalo_wzr-hp-g300nh-s $(Device/buffalo_wzr-hp-g300nh) DEVICE_MODEL := WZR-HP-G300NH (RTL8366S switch) + DEVICE_PACKAGES += kmod-switch-rtl8366rb endef TARGET_DEVICES += buffalo_wzr-hp-g300nh-s From 96d056f5f0894f492e5a4102d954d54ea7a741d0 Mon Sep 17 00:00:00 2001 From: Luiz Angelo Daros de Luca Date: Tue, 26 Apr 2022 19:28:34 -0300 Subject: [PATCH 05/36] kernel: netdevices: add rtl8367 module Create a package for rtl8367 to use it as loadable module instead of a builtin one. Signed-off-by: Luiz Angelo Daros de Luca --- package/kernel/linux/modules/netdevices.mk | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index 7b8e808e6d..cc15885148 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -399,6 +399,22 @@ endef $(eval $(call KernelPackage,switch-rtl8366s)) +define KernelPackage/switch-rtl8367 + SUBMENU:=$(NETWORK_DEVICES_MENU) + TITLE:=Realtek RTL8367 switch support + DEPENDS:=+kmod-switch-rtl8366-smi + KCONFIG:=CONFIG_RTL8367_PHY + FILES:=$(LINUX_DIR)/drivers/net/phy/rtl8367.ko + AUTOLOAD:=$(call AutoLoad,43,rtl8367,1) +endef + +define KernelPackage/switch-rtl8367/description + Realtek RTL8367 switch support +endef + +$(eval $(call KernelPackage,switch-rtl8367)) + + define KernelPackage/switch-rtl8367b SUBMENU:=$(NETWORK_DEVICES_MENU) TITLE:=Realtek RTL8367R/B switch support From b168a07799663c84c5e72c1b94e01fab590fc6f8 Mon Sep 17 00:00:00 2001 From: Luiz Angelo Daros de Luca Date: Tue, 26 Apr 2022 19:30:54 -0300 Subject: [PATCH 06/36] ath79: use rtl8367 as a module rtl8367 is used only by tl-wr2543-v1. Tested both normal and failsafe modes. Signed-off-by: Luiz Angelo Daros de Luca --- target/linux/ath79/generic/config-default | 1 - target/linux/ath79/image/generic-tp-link.mk | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/target/linux/ath79/generic/config-default b/target/linux/ath79/generic/config-default index bc619cd9b8..3b986f6620 100644 --- a/target/linux/ath79/generic/config-default +++ b/target/linux/ath79/generic/config-default @@ -21,6 +21,5 @@ CONFIG_REALTEK_PHY=y CONFIG_REGULATOR_FIXED_VOLTAGE=y CONFIG_RTL8366S_PHY=y CONFIG_RTL8366_SMI=y -CONFIG_RTL8367_PHY=y CONFIG_VITESSE_PHY=y CONFIG_WATCHDOG_CORE=y diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk index 21cbade7cc..ffe1d6e290 100644 --- a/target/linux/ath79/image/generic-tp-link.mk +++ b/target/linux/ath79/image/generic-tp-link.mk @@ -750,7 +750,7 @@ define Device/tplink_tl-wr2543-v1 SOC := ar7242 DEVICE_MODEL := TL-WR2543N/ND DEVICE_VARIANT := v1 - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-switch-rtl8367 TPLINK_HWID := 0x25430001 IMAGE/sysupgrade.bin := tplink-v1-image sysupgrade -v 3.13.99 | \ check-size | append-metadata From b129923b572a4feca3a7d7cf231b88bbe685b40b Mon Sep 17 00:00:00 2001 From: Luiz Angelo Daros de Luca Date: Wed, 27 Apr 2022 14:55:52 -0300 Subject: [PATCH 07/36] kernel: netdevices: load rtl8366s on boot This external switch driver should be loaded on boot for network support in failsafe mode. Signed-off-by: Luiz Angelo Daros de Luca --- package/kernel/linux/modules/netdevices.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index cc15885148..2e81835fe1 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -389,7 +389,7 @@ define KernelPackage/switch-rtl8366s DEPENDS:=+kmod-switch-rtl8366-smi KCONFIG:=CONFIG_RTL8366S_PHY FILES:=$(LINUX_DIR)/drivers/net/phy/rtl8366s.ko - AUTOLOAD:=$(call AutoLoad,43,rtl8366s) + AUTOLOAD:=$(call AutoLoad,43,rtl8366s,1) endef define KernelPackage/switch-rtl8366s/description From 6e0f0eae5b48bddead035d9dd89b710c10c50337 Mon Sep 17 00:00:00 2001 From: Luiz Angelo Daros de Luca Date: Wed, 27 Apr 2022 14:58:33 -0300 Subject: [PATCH 08/36] ath79: use rtl8366s and rtl8366_smi as a module rtl8366s is used only by dlink_dir-825-b1 and the netgear_wndr family (wndr3700, wndr3700-v2, wndr3800ch, wndr3800.dts, wndrmac-v1, wndrmac-v2). Not tested in real hardware. With rtl8366rb, rtl8366s, rtl8367 as modules, rtl8366_smi can also be a loadable module. This change was tested with tl-wr2543-v1. Signed-off-by: Luiz Angelo Daros de Luca --- target/linux/ath79/generic/config-default | 2 -- target/linux/ath79/image/generic.mk | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/target/linux/ath79/generic/config-default b/target/linux/ath79/generic/config-default index 3b986f6620..dd59a35490 100644 --- a/target/linux/ath79/generic/config-default +++ b/target/linux/ath79/generic/config-default @@ -19,7 +19,5 @@ CONFIG_PHY_AR7100_USB=y CONFIG_PHY_AR7200_USB=y CONFIG_REALTEK_PHY=y CONFIG_REGULATOR_FIXED_VOLTAGE=y -CONFIG_RTL8366S_PHY=y -CONFIG_RTL8366_SMI=y CONFIG_VITESSE_PHY=y CONFIG_WATCHDOG_CORE=y diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 4cc89a4b97..7442a0f68c 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -998,7 +998,7 @@ define Device/dlink_dir-825-b1 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \ check-size | append-metadata DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \ - kmod-leds-reset kmod-owl-loader + kmod-leds-reset kmod-owl-loader kmod-switch-rtl8366s SUPPORTED_DEVICES += dir-825-b1 endef TARGET_DEVICES += dlink_dir-825-b1 @@ -1709,7 +1709,7 @@ define Device/netgear_wndr3x00 $(Device/netgear_generic) SOC := ar7161 DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \ - kmod-leds-reset kmod-owl-loader + kmod-leds-reset kmod-owl-loader kmod-switch-rtl8366s endef define Device/netgear_wndr3700 From 668619425526cb0d43f8536a2f6f15a6314e6553 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Fri, 1 Jul 2022 15:01:13 +0200 Subject: [PATCH 09/36] mediatek: mt7622: fix banana pi r64 wps button Fix the wps button to prevent wrongly detected recovery procedures. In the official banana pi r64 git the wps button is set to GPIO_ACTIVE_LOW and not GPIO_ACTIVE_HIGH. Import patch to fix on boot unwanted recovery entering: Press the [f] key and hit [enter] to enter failsafe mode Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level - failsafe button wps was pressed - - failsafe - Signed-off-by: Nick Hainke --- ...20-dts-mt7622-bpi-r64-fix-wps-button.patch | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 target/linux/mediatek/patches-5.15/920-dts-mt7622-bpi-r64-fix-wps-button.patch diff --git a/target/linux/mediatek/patches-5.15/920-dts-mt7622-bpi-r64-fix-wps-button.patch b/target/linux/mediatek/patches-5.15/920-dts-mt7622-bpi-r64-fix-wps-button.patch new file mode 100644 index 0000000000..a5bbed1a6e --- /dev/null +++ b/target/linux/mediatek/patches-5.15/920-dts-mt7622-bpi-r64-fix-wps-button.patch @@ -0,0 +1,45 @@ +From dd1d420f40e75c3881a04001e6f2798492ee83c2 Mon Sep 17 00:00:00 2001 +From: Nick Hainke +Date: Thu, 30 Jun 2022 12:32:20 +0200 +Subject: [PATCH] arm64: dts: mt7622: fix BPI-R64 WPS button + +The bananapi R64 (BPI-R64) experiences wrong WPS button signals. +In OpenWrt pushing the WPS button while powering on the device will set +it to recovery mode. Currently, this also happens without any user +interaction. In particular, the wrong signals appear while booting the +device or restarting it, e.g. after doing a system upgrade. If the +device is in recovery mode the user needs to manually power cycle or +restart it. + +The official BPI-R64 sources set the WPS button to GPIO_ACTIVE_LOW in +the device tree. This setting seems to suppress the unwanted WPS button +press signals. So this commit changes the button from GPIO_ACTIVE_HIGH to +GPIO_ACTIVE_LOW. + +The official BPI-R64 sources can be found on +https://github.com/BPI-SINOVOIP/BPI-R64-openwrt + +Fixes: 0b6286dd96c0 ("arm64: dts: mt7622: add bananapi BPI-R64 board") + +Suggested-by: INAGAKI Hiroshi +Signed-off-by: Nick Hainke +--- + arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts +index 2b9bf8dd14ec..7538918c7a82 100644 +--- a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts ++++ b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts +@@ -49,7 +49,7 @@ factory { + wps { + label = "wps"; + linux,code = ; +- gpios = <&pio 102 GPIO_ACTIVE_HIGH>; ++ gpios = <&pio 102 GPIO_ACTIVE_LOW>; + }; + }; + +-- +2.37.0 + From 3c3367f03e3e45fb87698df9777eb0e3cf83f7b3 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Fri, 1 Jul 2022 15:25:29 +0200 Subject: [PATCH 10/36] generic: 5.15: refresh patches Refresh patches: - 402-mtd-blktrans-call-add-disks-after-mtd-device.patch - 420-mtd-set-rootfs-to-be-root-dev.patch - 495-mtd-core-add-get_mtd_device_by_node.patch Signed-off-by: Nick Hainke --- .../402-mtd-blktrans-call-add-disks-after-mtd-device.patch | 2 +- .../generic/hack-5.15/420-mtd-set-rootfs-to-be-root-dev.patch | 2 +- .../pending-5.15/495-mtd-core-add-get_mtd_device_by_node.patch | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/target/linux/generic/hack-5.15/402-mtd-blktrans-call-add-disks-after-mtd-device.patch b/target/linux/generic/hack-5.15/402-mtd-blktrans-call-add-disks-after-mtd-device.patch index d0f81c485b..88ca07f517 100644 --- a/target/linux/generic/hack-5.15/402-mtd-blktrans-call-add-disks-after-mtd-device.patch +++ b/target/linux/generic/hack-5.15/402-mtd-blktrans-call-add-disks-after-mtd-device.patch @@ -77,7 +77,7 @@ Signed-off-by: Daniel Golle #include "mtdcore.h" -@@ -1002,6 +1003,8 @@ int mtd_device_parse_register(struct mtd +@@ -1012,6 +1013,8 @@ int mtd_device_parse_register(struct mtd ret = mtd_otp_nvmem_add(mtd); diff --git a/target/linux/generic/hack-5.15/420-mtd-set-rootfs-to-be-root-dev.patch b/target/linux/generic/hack-5.15/420-mtd-set-rootfs-to-be-root-dev.patch index 8ac1dca238..4cefe35e55 100644 --- a/target/linux/generic/hack-5.15/420-mtd-set-rootfs-to-be-root-dev.patch +++ b/target/linux/generic/hack-5.15/420-mtd-set-rootfs-to-be-root-dev.patch @@ -20,7 +20,7 @@ Signed-off-by: Gabor Juhos #include #include -@@ -697,6 +698,16 @@ int add_mtd_device(struct mtd_info *mtd) +@@ -707,6 +708,16 @@ int add_mtd_device(struct mtd_info *mtd) of this try_ nonsense, and no bitching about it either. :) */ __module_get(THIS_MODULE); diff --git a/target/linux/generic/pending-5.15/495-mtd-core-add-get_mtd_device_by_node.patch b/target/linux/generic/pending-5.15/495-mtd-core-add-get_mtd_device_by_node.patch index a708a46b04..d1b2c9d1a5 100644 --- a/target/linux/generic/pending-5.15/495-mtd-core-add-get_mtd_device_by_node.patch +++ b/target/linux/generic/pending-5.15/495-mtd-core-add-get_mtd_device_by_node.patch @@ -17,7 +17,7 @@ Reviewed-by: Miquel Raynal --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c -@@ -1203,6 +1203,44 @@ out_unlock: +@@ -1213,6 +1213,44 @@ out_unlock: } EXPORT_SYMBOL_GPL(get_mtd_device_nm); From 04545c4325c627ba09e429693d8aa22b1624e218 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Fri, 1 Jul 2022 15:26:16 +0200 Subject: [PATCH 11/36] mediatek: 5.15: refresh patches Refresh patches: - 510-net-mediatek-add-flow-offload-for-mt7623.patch - 920-dts-mt7622-bpi-r64-fix-wps-button.patch Signed-off-by: Nick Hainke --- .../510-net-mediatek-add-flow-offload-for-mt7623.patch | 2 +- .../920-dts-mt7622-bpi-r64-fix-wps-button.patch | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/target/linux/mediatek/patches-5.15/510-net-mediatek-add-flow-offload-for-mt7623.patch b/target/linux/mediatek/patches-5.15/510-net-mediatek-add-flow-offload-for-mt7623.patch index b521bd529d..deb25e652d 100644 --- a/target/linux/mediatek/patches-5.15/510-net-mediatek-add-flow-offload-for-mt7623.patch +++ b/target/linux/mediatek/patches-5.15/510-net-mediatek-add-flow-offload-for-mt7623.patch @@ -14,7 +14,7 @@ Signed-off-by: Frank Wunderlich --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3678,6 +3678,7 @@ static const struct mtk_soc_data mt2701_ +@@ -3675,6 +3675,7 @@ static const struct mtk_soc_data mt2701_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7623_CLKS_BITMAP, .required_pctl = true, diff --git a/target/linux/mediatek/patches-5.15/920-dts-mt7622-bpi-r64-fix-wps-button.patch b/target/linux/mediatek/patches-5.15/920-dts-mt7622-bpi-r64-fix-wps-button.patch index a5bbed1a6e..ba852ad286 100644 --- a/target/linux/mediatek/patches-5.15/920-dts-mt7622-bpi-r64-fix-wps-button.patch +++ b/target/linux/mediatek/patches-5.15/920-dts-mt7622-bpi-r64-fix-wps-button.patch @@ -27,11 +27,9 @@ Signed-off-by: Nick Hainke arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts -index 2b9bf8dd14ec..7538918c7a82 100644 --- a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts +++ b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts -@@ -49,7 +49,7 @@ factory { +@@ -54,7 +54,7 @@ wps { label = "wps"; linux,code = ; @@ -40,6 +38,3 @@ index 2b9bf8dd14ec..7538918c7a82 100644 }; }; --- -2.37.0 - From 36acb3db03a3cf7dee80a1fc3b6f8f70efd20294 Mon Sep 17 00:00:00 2001 From: Alexandru Gagniuc Date: Sat, 21 May 2022 21:59:10 -0500 Subject: [PATCH 12/36] realtek: EnGenius EWS2910P: declare and hog the poe-enable GPIO GPIO 1 on the RTL8231 is used to force the PoE MCU to disable power outputs. It is not used by any driver, but if accidentally set low, PoE outputs are disabled. This situation is hard to debug, and requires knowledge of the Broadcom PoE protocol used by the MCU. To prevent this situation, hog it as an output high. This is consistent with the ZyXel GS1900 series handles it. Signed-off-by: Alexandru Gagniuc --- .../linux/realtek/dts-5.10/rtl8380_engenius_ews2910p.dts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/target/linux/realtek/dts-5.10/rtl8380_engenius_ews2910p.dts b/target/linux/realtek/dts-5.10/rtl8380_engenius_ews2910p.dts index f87c9585f9..dd57b2bf48 100644 --- a/target/linux/realtek/dts-5.10/rtl8380_engenius_ews2910p.dts +++ b/target/linux/realtek/dts-5.10/rtl8380_engenius_ews2910p.dts @@ -43,6 +43,13 @@ gpio-controller; indirect-access-bus-id = <0>; + poe_enable { + gpio-hog; + gpios = <1 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "poe-enable"; + }; + sff_p9_gpios { gpio-hog; gpios = < 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>, From 51e9d496ba7958fb9f2d3eb4bc7f257837145dd0 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 2 Jul 2022 16:53:54 +0200 Subject: [PATCH 13/36] mac80211: fix mesh queue selection issue Signed-off-by: Felix Fietkau --- ...ue-selection-for-mesh-OCB-interfaces.patch | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 package/kernel/mac80211/patches/subsys/337-mac80211-fix-queue-selection-for-mesh-OCB-interfaces.patch diff --git a/package/kernel/mac80211/patches/subsys/337-mac80211-fix-queue-selection-for-mesh-OCB-interfaces.patch b/package/kernel/mac80211/patches/subsys/337-mac80211-fix-queue-selection-for-mesh-OCB-interfaces.patch new file mode 100644 index 0000000000..9547db03d1 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/337-mac80211-fix-queue-selection-for-mesh-OCB-interfaces.patch @@ -0,0 +1,28 @@ +From: Felix Fietkau +Date: Sat, 2 Jul 2022 16:41:32 +0200 +Subject: [PATCH] mac80211: fix queue selection for mesh/OCB interfaces + +When using iTXQ, the code assumes that there is only one vif queue for +broadcast packets, using the BE queue. Allowing non-BE queue marking +violates that assumption and txq->ac == skb_queue_mapping is no longer +guaranteed. This can cause issues with queue handling in the driver and +also causes issues with the recent ATF change, resulting in an AQL +underflow warning. + +Cc: stable@vger.kernel.org +Signed-off-by: Felix Fietkau +--- + +--- a/net/mac80211/wme.c ++++ b/net/mac80211/wme.c +@@ -147,8 +147,8 @@ u16 __ieee80211_select_queue(struct ieee + bool qos; + + /* all mesh/ocb stations are required to support WME */ +- if (sdata->vif.type == NL80211_IFTYPE_MESH_POINT || +- sdata->vif.type == NL80211_IFTYPE_OCB) ++ if (sta && (sdata->vif.type == NL80211_IFTYPE_MESH_POINT || ++ sdata->vif.type == NL80211_IFTYPE_OCB)) + qos = true; + else if (sta) + qos = sta->sta.wme; From 8e90abb39615e25a03f255f2c16c9203ab976ae7 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 2 Jul 2022 16:55:13 +0200 Subject: [PATCH 14/36] mt76: update to the latest version c07f45927839 firmware: update mt7622 firmware to version 20220630 af406a2d1c36 mt76: do not use skb_set_queue_mapping for internal purposes Signed-off-by: Felix Fietkau --- package/kernel/mt76/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 13d744bce9..e008349ceb 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2022-06-24 -PKG_SOURCE_VERSION:=b6e865e2cc7080c91ec34a9dd3648d25f7ce04c6 -PKG_MIRROR_HASH:=4d311e55431400266a1d58534ea22421b080670f937df3d9ad1fb9a9d0362bda +PKG_SOURCE_DATE:=2022-07-02 +PKG_SOURCE_VERSION:=af406a2d1c364ebfef50cebcf0357860294a205a +PKG_MIRROR_HASH:=79002a487b4a9e9c8fa6b98ead2e34b6225572bd4a64f7d1251687ac747836e4 PKG_MAINTAINER:=Felix Fietkau PKG_USE_NINJA:=0 From 24eee4b2443d75f51a91fd321c68705a6f376ccc Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 2 Jul 2022 16:57:52 +0200 Subject: [PATCH 15/36] mac80211: rename patch to avoid duplicate patch number Signed-off-by: Felix Fietkau --- ...38-mac80211-fix-queue-selection-for-mesh-OCB-interfaces.patch} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename package/kernel/mac80211/patches/subsys/{337-mac80211-fix-queue-selection-for-mesh-OCB-interfaces.patch => 338-mac80211-fix-queue-selection-for-mesh-OCB-interfaces.patch} (100%) diff --git a/package/kernel/mac80211/patches/subsys/337-mac80211-fix-queue-selection-for-mesh-OCB-interfaces.patch b/package/kernel/mac80211/patches/subsys/338-mac80211-fix-queue-selection-for-mesh-OCB-interfaces.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/337-mac80211-fix-queue-selection-for-mesh-OCB-interfaces.patch rename to package/kernel/mac80211/patches/subsys/338-mac80211-fix-queue-selection-for-mesh-OCB-interfaces.patch From abc5b28db164dc2d807750cb2baae91e288c84a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Sun, 3 Jul 2022 13:22:00 +0200 Subject: [PATCH 16/36] bcm53xx: use -falign-functions=32 for kernel compilation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Northstar SoCs have pretty small CPU caches and their performance is heavily affected by cache hits & misses. It means that all kind of random code changes can affect performance as they often reorganize (change alignment & possibly reorder) kernel symbols. It was discussed in ARM / net mailinglists: 1. ARM router NAT performance affected by random/unrelated commits [1] [2] 2. Optimizing kernel compilation / alignments for network performance [3] [4] It seems that -falign-functions can be used as a partial workaround. It doesn't solve all cases (e.g. documented watchdog one [5]) but it surely helps with many of them. A complete long term solution may be PGO (profile-guided optimization) but it isn't available at this point. [1] https://lkml.org/lkml/2019/5/21/349 [2] https://www.spinics.net/lists/linux-block/msg40624.html [3] https://lore.kernel.org/linux-arm-kernel/066fc320-dc04-11a4-476e-b0d11f3b17e6@gmail.com/T/ [4] https://www.spinics.net/lists/netdev/msg816103.html [5] http://lists.openwrt.org/pipermail/openwrt-devel/2022-July/038989.html Signed-off-by: Rafał Miłecki --- config/Config-devel.in | 1 + 1 file changed, 1 insertion(+) diff --git a/config/Config-devel.in b/config/Config-devel.in index a068f694e5..87f9157106 100644 --- a/config/Config-devel.in +++ b/config/Config-devel.in @@ -76,6 +76,7 @@ menuconfig DEVEL config KERNEL_CFLAGS string "Kernel extra CFLAGS" if DEVEL + default "-falign-functions=32" if TARGET_bcm53xx default "" config EXTERNAL_KERNEL_TREE From 06d0cc2fb365485dd1ddd32937afd5091fa4b8a8 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 3 Jul 2022 19:24:48 +0200 Subject: [PATCH 17/36] mt76: update to the latest version 93e3fce916c6 mt76: pass original queue id from __mt76_tx_queue_skb to the driver Signed-off-by: Felix Fietkau --- package/kernel/mt76/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index e008349ceb..354449b810 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2022-07-02 -PKG_SOURCE_VERSION:=af406a2d1c364ebfef50cebcf0357860294a205a -PKG_MIRROR_HASH:=79002a487b4a9e9c8fa6b98ead2e34b6225572bd4a64f7d1251687ac747836e4 +PKG_SOURCE_DATE:=2022-07-03 +PKG_SOURCE_VERSION:=93e3fce916c62d06892d41bf00d0f4c2926c9a0b +PKG_MIRROR_HASH:=ad966e7aa81301f0601ceb7aae2ecb471c452f5d8366f701add807152fd08971 PKG_MAINTAINER:=Felix Fietkau PKG_USE_NINJA:=0 From 90a63504230ed31303bf7978658ba5db74f54f84 Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Mon, 27 Jun 2022 09:02:15 +0100 Subject: [PATCH 18/36] kernel: bump 5.15 to 5.15.50 Patches automatically rebased. Signed-off-by: Rui Salvaterra --- include/kernel-5.15 | 4 ++-- ...amba_pl011-Don-t-use-DT-aliases-for-numbering.patch | 2 +- .../950-0057-amba_pl011-Round-input-clock-up.patch | 10 +++++----- ...ba_pl011-Add-cts-event-workaround-DT-property.patch | 2 +- ...0-0060-tty-amba-pl011-Add-un-throttle-support.patch | 2 +- .../700-net-ethernet-mediatek-support-net-labels.patch | 4 ++-- .../840-serial-add-ugly-custom-baud-rate-hack.patch | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/kernel-5.15 b/include/kernel-5.15 index 298602d595..1319666eb8 100644 --- a/include/kernel-5.15 +++ b/include/kernel-5.15 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.15 = .49 -LINUX_KERNEL_HASH-5.15.49 = 32497893ba47f4ad32a59fa4254e8c25e41bc821798e3b2f2443822fa00059dc +LINUX_VERSION-5.15 = .50 +LINUX_KERNEL_HASH-5.15.50 = 554d507d37a23810fe8c83912761e4a4f73c40794bc685ff7ca98042fe1bd70f diff --git a/target/linux/bcm27xx/patches-5.15/950-0056-amba_pl011-Don-t-use-DT-aliases-for-numbering.patch b/target/linux/bcm27xx/patches-5.15/950-0056-amba_pl011-Don-t-use-DT-aliases-for-numbering.patch index cbb0c19aa5..0fa06335aa 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0056-amba_pl011-Don-t-use-DT-aliases-for-numbering.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0056-amba_pl011-Don-t-use-DT-aliases-for-numbering.patch @@ -14,7 +14,7 @@ use the same logic. --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c -@@ -2738,7 +2738,12 @@ static int pl011_setup_port(struct devic +@@ -2725,7 +2725,12 @@ static int pl011_setup_port(struct devic if (IS_ERR(base)) return PTR_ERR(base); diff --git a/target/linux/bcm27xx/patches-5.15/950-0057-amba_pl011-Round-input-clock-up.patch b/target/linux/bcm27xx/patches-5.15/950-0057-amba_pl011-Round-input-clock-up.patch index c1fc11f7fb..96435fe809 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0057-amba_pl011-Round-input-clock-up.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0057-amba_pl011-Round-input-clock-up.patch @@ -26,7 +26,7 @@ Signed-off-by: Phil Elwell --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c -@@ -1725,6 +1725,23 @@ static void pl011_put_poll_char(struct u +@@ -1718,6 +1718,23 @@ static void pl011_put_poll_char(struct u #endif /* CONFIG_CONSOLE_POLL */ @@ -50,7 +50,7 @@ Signed-off-by: Phil Elwell static int pl011_hwinit(struct uart_port *port) { struct uart_amba_port *uap = -@@ -1741,7 +1758,7 @@ static int pl011_hwinit(struct uart_port +@@ -1734,7 +1751,7 @@ static int pl011_hwinit(struct uart_port if (retval) return retval; @@ -59,7 +59,7 @@ Signed-off-by: Phil Elwell /* Clear pending error and receive interrupts */ pl011_write(UART011_OEIS | UART011_BEIS | UART011_PEIS | -@@ -2434,7 +2451,7 @@ static int pl011_console_setup(struct co +@@ -2421,7 +2438,7 @@ static int pl011_console_setup(struct co plat->init(); } @@ -68,7 +68,7 @@ Signed-off-by: Phil Elwell if (uap->vendor->fixed_options) { baud = uap->fixed_baud; -@@ -2651,6 +2668,7 @@ static struct uart_driver amba_reg = { +@@ -2638,6 +2655,7 @@ static struct uart_driver amba_reg = { .cons = AMBA_CONSOLE, }; @@ -76,7 +76,7 @@ Signed-off-by: Phil Elwell static int pl011_probe_dt_alias(int index, struct device *dev) { struct device_node *np; -@@ -2682,6 +2700,7 @@ static int pl011_probe_dt_alias(int inde +@@ -2669,6 +2687,7 @@ static int pl011_probe_dt_alias(int inde return ret; } diff --git a/target/linux/bcm27xx/patches-5.15/950-0059-amba_pl011-Add-cts-event-workaround-DT-property.patch b/target/linux/bcm27xx/patches-5.15/950-0059-amba_pl011-Add-cts-event-workaround-DT-property.patch index 4ef26a10e3..5dfe214100 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0059-amba_pl011-Add-cts-event-workaround-DT-property.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0059-amba_pl011-Add-cts-event-workaround-DT-property.patch @@ -36,7 +36,7 @@ Signed-off-by: Phil Elwell - reg --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c -@@ -2829,6 +2829,11 @@ static int pl011_probe(struct amba_devic +@@ -2816,6 +2816,11 @@ static int pl011_probe(struct amba_devic if (IS_ERR(uap->clk)) return PTR_ERR(uap->clk); diff --git a/target/linux/bcm27xx/patches-5.15/950-0060-tty-amba-pl011-Add-un-throttle-support.patch b/target/linux/bcm27xx/patches-5.15/950-0060-tty-amba-pl011-Add-un-throttle-support.patch index db01441aa0..3b0bca7adb 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0060-tty-amba-pl011-Add-un-throttle-support.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0060-tty-amba-pl011-Add-un-throttle-support.patch @@ -50,7 +50,7 @@ Signed-off-by: Phil Elwell static void pl011_stop_rx(struct uart_port *port) { struct uart_amba_port *uap = -@@ -2276,6 +2302,8 @@ static const struct uart_ops amba_pl011_ +@@ -2263,6 +2289,8 @@ static const struct uart_ops amba_pl011_ .stop_tx = pl011_stop_tx, .start_tx = pl011_start_tx, .stop_rx = pl011_stop_rx, diff --git a/target/linux/ramips/patches-5.15/700-net-ethernet-mediatek-support-net-labels.patch b/target/linux/ramips/patches-5.15/700-net-ethernet-mediatek-support-net-labels.patch index 267d3d5dd6..f6ac8360ee 100644 --- a/target/linux/ramips/patches-5.15/700-net-ethernet-mediatek-support-net-labels.patch +++ b/target/linux/ramips/patches-5.15/700-net-ethernet-mediatek-support-net-labels.patch @@ -14,7 +14,7 @@ Signed-off-by: René van Dorst --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3293,6 +3293,7 @@ static const struct net_device_ops mtk_n +@@ -3290,6 +3290,7 @@ static const struct net_device_ops mtk_n static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) { @@ -22,7 +22,7 @@ Signed-off-by: René van Dorst const __be32 *_id = of_get_property(np, "reg", NULL); phy_interface_t phy_mode; struct phylink *phylink; -@@ -3388,6 +3389,9 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -3385,6 +3386,9 @@ static int mtk_add_mac(struct mtk_eth *e else eth->netdev[id]->max_mtu = MTK_MAX_RX_LENGTH_2K - MTK_RX_ETH_HLEN; diff --git a/target/linux/ramips/patches-5.15/840-serial-add-ugly-custom-baud-rate-hack.patch b/target/linux/ramips/patches-5.15/840-serial-add-ugly-custom-baud-rate-hack.patch index d7cf2dfd48..7148bb16f3 100644 --- a/target/linux/ramips/patches-5.15/840-serial-add-ugly-custom-baud-rate-hack.patch +++ b/target/linux/ramips/patches-5.15/840-serial-add-ugly-custom-baud-rate-hack.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c -@@ -401,6 +401,9 @@ uart_get_baud_rate(struct uart_port *por +@@ -393,6 +393,9 @@ uart_get_baud_rate(struct uart_port *por break; } From f60628f33ca9891fd9fb814588530df56ebdcdca Mon Sep 17 00:00:00 2001 From: Michael Yartys Date: Sun, 13 Feb 2022 15:09:56 +0100 Subject: [PATCH 19/36] hostapd: enable compilation of OCV and add build feature discovery Operating Channel Validation (OCV) is a security feature designed to prevent person-in-the-middle multi-channel attacks. Compile the -basic and -full variants of hostapd with this feature, and enable discovery of this feature for future luci integration. OCV can be configured by setting ocv equal to one of the following values in the wireless config: 0 = disabled (hostapd/wpa_supplicant default) 1 = enabled 2 = enabled in workaround mode - Allow STA that claims OCV capability to connect even if the STA doesn't send OCI or negotiate PMF. Signed-off-by: Michael Yartys --- package/network/services/hostapd/files/hostapd-basic.config | 2 +- package/network/services/hostapd/files/hostapd-full.config | 2 +- package/network/services/hostapd/files/hostapd.sh | 6 +++++- .../network/services/hostapd/src/src/utils/build_features.h | 4 ++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/package/network/services/hostapd/files/hostapd-basic.config b/package/network/services/hostapd/files/hostapd-basic.config index 1f52546d57..3d19d8f902 100644 --- a/package/network/services/hostapd/files/hostapd-basic.config +++ b/package/network/services/hostapd/files/hostapd-basic.config @@ -54,7 +54,7 @@ CONFIG_RSN_PREAUTH=y #CONFIG_IEEE80211W=y # Support Operating Channel Validation -#CONFIG_OCV=y +CONFIG_OCV=y # Integrated EAP server #CONFIG_EAP=y diff --git a/package/network/services/hostapd/files/hostapd-full.config b/package/network/services/hostapd/files/hostapd-full.config index 4e942a60b2..b92f9a25b8 100644 --- a/package/network/services/hostapd/files/hostapd-full.config +++ b/package/network/services/hostapd/files/hostapd-full.config @@ -54,7 +54,7 @@ CONFIG_RSN_PREAUTH=y #CONFIG_IEEE80211W=y # Support Operating Channel Validation -#CONFIG_OCV=y +CONFIG_OCV=y # Integrated EAP server CONFIG_EAP=y diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 760b3ff792..831c562b47 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -372,6 +372,8 @@ hostapd_common_add_bss_config() { config_add_boolean fils config_add_string fils_dhcp + + config_add_int ocv } hostapd_set_vlan_file() { @@ -544,7 +546,7 @@ hostapd_set_bss_options() { airtime_bss_weight airtime_bss_limit airtime_sta_weight \ multicast_to_unicast proxy_arp per_sta_vif \ eap_server eap_user_file ca_cert server_cert private_key private_key_passwd server_id \ - vendor_elements fils + vendor_elements fils ocv set_default fils 0 set_default isolate 0 @@ -617,6 +619,8 @@ hostapd_set_bss_options() { json_for_each_item append_radius_acct_req_attr radius_acct_req_attr } + [ -n "$ocv" ] && append bss_conf "ocv=$ocv" "$N" + case "$auth_type" in sae|owe|eap192|eap-eap192) set_default ieee80211w 2 diff --git a/package/network/services/hostapd/src/src/utils/build_features.h b/package/network/services/hostapd/src/src/utils/build_features.h index cb7cb72731..642a35836e 100644 --- a/package/network/services/hostapd/src/src/utils/build_features.h +++ b/package/network/services/hostapd/src/src/utils/build_features.h @@ -54,6 +54,10 @@ static inline int has_feature(const char *feat) #ifdef CONFIG_FILS if (!strcmp(feat, "fils")) return 1; +#endif +#ifdef CONFIG_OCV + if (!strcmp(feat, "ocv")) + return 1; #endif return 0; } From 442708dfe2f599796b87eb113b03ab6cc42e0292 Mon Sep 17 00:00:00 2001 From: Michael Yartys Date: Sun, 13 Feb 2022 15:17:54 +0100 Subject: [PATCH 20/36] wpa_supplicant: compile with OCV support Operating Channel Validation (OCV) is a security feature designed to prevent person-in-the-middle multi-channel attacks. Compile -basic and -full variants with support for OCV. This feature can be configured in the wireless config by setting ocv equal to one of the following values: 0 = disabled (hostapd/wpa_supplicant default) 1 = enabled if wpa_supplicant's SME in use. Otherwise enabled only when the driver indicates support for operating channel validation. Signed-off-by: Michael Yartys --- package/network/services/hostapd/files/hostapd.sh | 4 +++- .../services/hostapd/files/wpa_supplicant-basic.config | 2 +- .../network/services/hostapd/files/wpa_supplicant-full.config | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 831c562b47..f11b40702c 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -1272,7 +1272,7 @@ wpa_supplicant_add_network() { json_get_vars \ ssid bssid key \ basic_rate mcast_rate \ - ieee80211w ieee80211r fils \ + ieee80211w ieee80211r fils ocv \ multi_ap \ default_disabled @@ -1324,6 +1324,8 @@ wpa_supplicant_add_network() { [ "$default_disabled" = 1 ] && append network_data "disabled=1" "$N$T" } + [ -n "$ocv" ] && append network_data "ocv=$ocv" "$N$T" + case "$auth_type" in none) ;; owe) diff --git a/package/network/services/hostapd/files/wpa_supplicant-basic.config b/package/network/services/hostapd/files/wpa_supplicant-basic.config index c550b37b21..6abd8e2331 100644 --- a/package/network/services/hostapd/files/wpa_supplicant-basic.config +++ b/package/network/services/hostapd/files/wpa_supplicant-basic.config @@ -315,7 +315,7 @@ CONFIG_NO_LINUX_PACKET_SOCKET_WAR=y #CONFIG_IEEE80211W=y # Support Operating Channel Validation -#CONFIG_OCV=y +CONFIG_OCV=y # Select TLS implementation # openssl = OpenSSL (default) diff --git a/package/network/services/hostapd/files/wpa_supplicant-full.config b/package/network/services/hostapd/files/wpa_supplicant-full.config index de3302c875..d24fbbb01f 100644 --- a/package/network/services/hostapd/files/wpa_supplicant-full.config +++ b/package/network/services/hostapd/files/wpa_supplicant-full.config @@ -315,7 +315,7 @@ CONFIG_NO_LINUX_PACKET_SOCKET_WAR=y #CONFIG_IEEE80211W=y # Support Operating Channel Validation -#CONFIG_OCV=y +CONFIG_OCV=y # Select TLS implementation # openssl = OpenSSL (default) From 87092b3c065978fc0e673856c34b3db0829280db Mon Sep 17 00:00:00 2001 From: Mikhail Zhilkin Date: Fri, 18 Mar 2022 17:02:30 +0000 Subject: [PATCH 21/36] scripts: add support for Sercomm kernel header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This scripts creates custom kernel header that necessary for Sercomm mt7621 devices: - Sercomm S3 - Beeline SmartBox Giga - Beeline SmartBox Pro - Beeline Smartbox Turbo - Beeline Smartbox Turbo+ - WiFire S1500.NBN Header format ------------- +--------+---------------+------------------------+ | Offset | Value | Description | +========+===============+========================+ | 0x0 | 53 65 72 00 | Magic "Ser." | +--------+---------------+------------------------+ | 0x4 | 04 00 00 01 | End offset of RootFS | +--------+---------------+------------------------+ | | | This header checksum | | 0x8 | d6 14 9a c1 | htonl(~crc) | +--------+---------------+------------------------+ | 0xc | 02 ff ff ff | Constant | +--------+---------------+------------------------+ | 0x10 | 00 01 40 00 | Kernel start offset | +--------+---------------+------------------------+ | 0x14 | c6 94 24 00 | Kernel length | +--------+---------------+------------------------+ | | | Kernel checksum | | 0x18 | e7 78 89 f1 | htonl(~crc) | +--------+---------------+------------------------+ | 0x1c | 00 00 00 00 | Constant | +--------+---------------+------------------------+ | 0x20 | ff ff ff ff | Constant | +--------+---------------+------------------------+ | 0x24 | ff ff ff ff | Constant | +--------+---------------+------------------------+ | 0x28 | 00 00 00 01 | RootFS offset | +--------+---------------+------------------------+ | | | RootFS length | | 0x2c | 04 00 00 00 | Always 0x4, we check | | | | UBI magic only | +--------+---------------+------------------------+ | | | RootFS checksum | | 0x30 | 1c fc 55 2d | htonl(~crc) | | | | Const for UBI magic | +--------+---------------+------------------------+ | 0x34 | 00 00 00 00 | Constant | +--------+---------------+------------------------+ | 0x38 | ff ff ff ff … | Pad to 0x100 | +--------+---------------+------------------------+ Signed-off-by: Mikhail Zhilkin --- scripts/sercomm-kernel-header.py | 121 +++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100755 scripts/sercomm-kernel-header.py diff --git a/scripts/sercomm-kernel-header.py b/scripts/sercomm-kernel-header.py new file mode 100755 index 0000000000..bfb29c6fe0 --- /dev/null +++ b/scripts/sercomm-kernel-header.py @@ -0,0 +1,121 @@ +#!/usr/bin/env python3 +""" +# SPDX-License-Identifier: GPL-2.0-or-later +# +# sercomm-kernel-header.py: Creates Sercomm kernel header +# +# Copyright © 2022 Mikhail Zhilkin +""" + +import argparse +import binascii +import os +import struct + +KERNEL_HEADER_SIZE = 0x100 +PADDING = 0xff +ROOTFS_FAKE_HEADER = "UBI#" + +def auto_int(x): + return int(x, 0) + +def create_kernel_header(args): + out_file = open(args.header_file, "wb") + header = get_kernel_header(args) + out_file.write(header) + out_file.close() + +def get_kernel_header(args): + header = bytearray([PADDING] * KERNEL_HEADER_SIZE) + + struct.pack_into(' Date: Sat, 19 Mar 2022 19:35:51 +0000 Subject: [PATCH 22/36] scripts: add support for Sercomm PID This scripts creates Sercomm PID file. PID is necessary for the factory images creation of variuos Sercomm-based devices (Beeline, Netgear, Etisalat). Size: 0x70 +-------+------+---------------+------------------+ | Start | Size | Value* (ASCII)| Description | +=======+======+===============+==================+ | 0x0 | 0x8 | 10100 | Hardware version | +-------+------+---------------+------------------+ | 0x8 | 0x8 | 444245 (DBE) | Hardware ID | +-------+------+---------------+------------------+ | 0x64 | 0x4 | 1002 | Software version | +-------+------+---------------+------------------+ *for Beeline Smartbox GIGA Signed-off-by: Mikhail Zhilkin --- scripts/sercomm-pid.py | 102 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100755 scripts/sercomm-pid.py diff --git a/scripts/sercomm-pid.py b/scripts/sercomm-pid.py new file mode 100755 index 0000000000..b89977a5b9 --- /dev/null +++ b/scripts/sercomm-pid.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python3 +""" +# SPDX-License-Identifier: GPL-2.0-or-later +# +# sercomm-pid.py: Creates Sercomm device PID +# +# Copyright © 2022 Mikhail Zhilkin +""" + +import argparse +import binascii +import struct + +PID_SIZE = 0x70 +PADDING = 0x30 +PADDING_TAIL = 0x0 + +def auto_int(x): + return int(x, 0) + +def create_pid_file(args): + pid_file = open(args.pid_file, "wb") + buf = get_pid(args) + pid_file.write(buf) + pid_file.close() + +def get_pid(args): + buf = bytearray([PADDING] * PID_SIZE) + + enc = args.hw_version.rjust(8, '0').encode('ascii') + struct.pack_into('>8s', buf, 0x0, enc) + + enc = binascii.hexlify(args.hw_id.encode()) + struct.pack_into('>6s', buf, 0x8, enc) + + enc = args.sw_version.rjust(4, '0').encode('ascii') + struct.pack_into('>4s', buf, 0x64, enc) + + if (args.extra_padd_size): + tail = bytearray([PADDING_TAIL] * args.extra_padd_size) + if (args.extra_padd_byte): + struct.pack_into (' Date: Fri, 18 Mar 2022 18:09:45 +0000 Subject: [PATCH 23/36] ramips: add support for Beeline SmartBox GIGA Beeline SmartBox GIGA is a wireless WiFi 5 router manufactured by Sercomm company. Device specification -------------------- SoC Type: MediaTek MT7621AT RAM: 256 MiB, Nanya NT5CC128M16JR-EK Flash: 128 MiB, Macronix MX30LF1G18AC Wireless 2.4 GHz (MT7603EN): b/g/n, 2x2 Wireless 5 GHz (MT7613BE): a/n/ac, 2x2 Ethernet: 3 ports - 2xGbE (WAN, LAN1), 1xFE (LAN2) USB ports: 1xUSB3.0 Button: 1 button (Reset/WPS) PCB ID: DBE00B-1.6MM LEDs: 1 RGB LED Power: 12 VDC, 1.5 A Connector type: barrel Bootloader: U-Boot Installation ----------------- 1. Downgrade stock (Beeline) firmware to v.1.0.02; 2. Give factory OpenWrt image a shorter name, e.g. 1001.img; 3. Upload and update the firmware via the original web interface. Remark: You might need make the 3rd step twice if your running firmware is booted from the Slot 1 (Sercomm0 bootflag). The stock firmware reverses the bootflag (Sercomm0 / Sercomm1) on each firmware update. Revert to stock --------------- 1. Change the bootflag to Sercomm1 in OpenWrt CLI and then reboot: printf 1 | dd bs=1 seek=7 count=1 of=/dev/mtdblock3 2. Optional: Update with any stock (Beeline) firmware if you want to overwrite OpenWrt in Slot 0 completely. MAC Addresses ------------- +-----+-----------+---------+ | use | address | example | +-----+-----------+---------+ | LAN | label | *:16 | | WAN | label + 1 | *:17 | | 2g | label + 4 | *:1a | | 5g | label + 5 | *:1b | +-----+-----------+---------+ The label MAC address was found in Factory 0x21000 Notes ----- 1. The following scripts are required for the build: sercomm-crypto.py - already exists in OpenWrt sercomm-partition-tag.py - already exists in OpenWrt sercomm-payload.py - already exists in OpenWrt sercomm-pid.py - new, the part of this pull request sercomm-kernel-header.py - new, the part of this pull request 2. This device (same as other Sercomm S2,S3-based devices) requires special LZMA and LOADADDR settings for successful boot: LZMA_TEXT_START=0x82800000 KERNEL_LOADADDR=0x81001000 LOADADDR=0x80001000 3. This device (same as several other Sercomm-based devices - Beeline, Netgear, Etisalat, Rostelecom) has partition map (mtd1) containing real partition offsets, which may differ from device to device depending on the number and location of bad blocks on NAND. "fixed-partitions" is used if the partition map is not found or corrupted. This behavour (it's the same as on stock firmware) is provided by MTD_SERCOMM_PARTS module. Signed-off-by: Mikhail Zhilkin --- package/boot/uboot-envtools/files/ramips | 3 + .../dts/mt7621_beeline_smartbox-giga.dts | 237 ++++++++++++++++++ target/linux/ramips/image/Makefile | 7 +- target/linux/ramips/image/common-sercomm.mk | 87 +++++++ target/linux/ramips/image/mt7621.mk | 14 ++ .../mt7621/base-files/etc/board.d/01_leds | 3 +- .../mt7621/base-files/etc/board.d/02_network | 1 + .../mt7621/base-files/lib/upgrade/platform.sh | 1 + target/linux/ramips/mt7621/config-5.10 | 1 + target/linux/ramips/mt7621/config-5.15 | 1 + 10 files changed, 352 insertions(+), 3 deletions(-) create mode 100644 target/linux/ramips/dts/mt7621_beeline_smartbox-giga.dts create mode 100644 target/linux/ramips/image/common-sercomm.mk diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index eebc08d65d..2034749832 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -31,6 +31,9 @@ ampedwireless,ally-00x19k|\ ampedwireless,ally-r1900k) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" "4" ;; +beeline,smartbox-giga) + ubootenv_add_uci_config "/dev/mtd0" "0x80000" "0x1000" "0x20000" + ;; buffalo,wsr-1166dhp|\ buffalo,wsr-600dhp|\ mediatek,linkit-smart-7688|\ diff --git a/target/linux/ramips/dts/mt7621_beeline_smartbox-giga.dts b/target/linux/ramips/dts/mt7621_beeline_smartbox-giga.dts new file mode 100644 index 0000000000..efea79e2e2 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_beeline_smartbox-giga.dts @@ -0,0 +1,237 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include +#include + +/ { + compatible = "beeline,smartbox-giga", "mediatek,mt7621-soc"; + model = "Beeline SmartBox GIGA"; + + aliases { + label-mac-device = &gmac0; + + led-boot = &led_status_green; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_status_red; + }; + + leds { + compatible = "gpio-leds"; + + led_status_green: led-0 { + label = "green:status"; + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; + }; + + led-1 { + label = "blue:wan"; + color = ; + function = LED_FUNCTION_WAN; + gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; + }; + + led_status_red: led-2 { + label = "red:status"; + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + ubi-concat { + compatible = "mtd-concat"; + devices = <&ubiconcat0 &ubiconcat1 &ubiconcat2 \ + &ubiconcat3>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "ubi"; + reg = <0x0 0x5400000>; + }; + }; + }; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "sercomm,sc-partitions", "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x100000>; + sercomm,scpart-id = <0>; + read-only; + }; + + partition@100000 { + label = "dynamic partition map"; + reg = <0x100000 0x100000>; + sercomm,scpart-id = <1>; + }; + + factory: partition@200000 { + label = "Factory"; + reg = <0x200000 0x100000>; + sercomm,scpart-id = <2>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_21000: macaddr@21000 { + reg = <0x21000 0x6>; + }; + }; + + partition@300000 { + label = "Boot Flag"; + reg = <0x300000 0x100000>; + sercomm,scpart-id = <3>; + }; + + partition@400000 { + label = "kernel"; + reg = <0x400000 0x600000>; + sercomm,scpart-id = <4>; + }; + + partition@a00000 { + label = "Kernel 2"; + reg = <0xa00000 0x600000>; + sercomm,scpart-id = <5>; + read-only; + }; + + ubiconcat0: partition@1000000 { + label = "File System 1"; + reg = <0x1000000 0x1800000>; + sercomm,scpart-id = <6>; + }; + + partition@2800000 { + label = "File System 2"; + reg = <0x2800000 0x1800000>; + sercomm,scpart-id = <7>; + read-only; + }; + + ubiconcat1: partition@4000000 { + label = "Configuration/log"; + reg = <0x4000000 0x800000>; + sercomm,scpart-id = <8>; + }; + + ubiconcat2: partition@4800000 { + label = "application tmp buffer (Ftool)"; + reg = <0x4800000 0xc00000>; + sercomm,scpart-id = <9>; + }; + + ubiconcat3: partition@5400000 { + label = "container"; + reg = <0x5400000 0x2800000>; + sercomm,scpart-id = <10>; + }; + + partition@7c00000 { + label = "bad block reserved"; + reg = <0x7c00000 0x380000>; + sercomm,scpart-id = <11>; + read-only; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + + nvmem-cells = <&macaddr_factory_21000>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(5)>; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0>; + ieee80211-freq-limit = <2400000 2500000>; + + nvmem-cells = <&macaddr_factory_21000>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(4)>; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_21000>; + nvmem-cell-names = "mac-address"; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "wan"; + + nvmem-cells = <&macaddr_factory_21000>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(1)>; + }; + + port@1 { + status = "okay"; + label = "lan1"; + }; + + port@2 { + status = "okay"; + label = "lan2"; + }; + }; +}; + +&uartlite3 { + status = "okay"; +}; + +&state_default { + gpio { + groups = "i2c", "jtag"; + function = "gpio"; + }; +}; diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index f481e6e447..d48b220231 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk -DEVICE_VARS += LOADER_TYPE LOADER_FLASH_OFFS +DEVICE_VARS += LOADER_TYPE LOADER_FLASH_OFFS LZMA_TEXT_START DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID DEVICE_VARS += BUFFALO_TAG_PLATFORM BUFFALO_TAG_VERSION BUFFALO_TAG_MINOR DEVICE_VARS += SEAMA_SIGNATURE SEAMA_MTDBLOCK @@ -22,6 +22,7 @@ ldrplatform-$(CONFIG_TARGET_ramips_mt7621) := mt7621 ldrflashstart-y := 0x1c000000 ldrflashstart-$(CONFIG_TARGET_ramips_mt7621) := 0x1fc00000 +LOADADDR := $(loadaddr-y) LOADER_PLATFORM := $(ldrplatform-y) LOADER_FLASH_START := $(ldrflashstart-y) @@ -45,7 +46,8 @@ define Build/loader-common PKG_BUILD_DIR="$@.src" \ TARGET_DIR="$(dir $@)" LOADER_NAME="$(notdir $@)" \ BOARD="$(BOARDNAME)" PLATFORM="$(LOADER_PLATFORM)" \ - LZMA_TEXT_START=0x81800000 LOADADDR=$(KERNEL_LOADADDR) \ + LZMA_TEXT_START=$(LZMA_TEXT_START) \ + LOADADDR=$(LOADADDR) \ $(1) compile loader.$(LOADER_TYPE) mv "$@.$(LOADER_TYPE)" "$@" rm -rf $@.src @@ -176,6 +178,7 @@ define Device/Default PROFILES = Default KERNEL := $(KERNEL_DTB) | uImage lzma KERNEL_LOADADDR := $(loadaddr-y) + LZMA_TEXT_START := 0x81800000 SOC := $(DEFAULT_SOC) DEVICE_DTS_DIR := ../dts DEVICE_DTS = $$(SOC)_$(1) diff --git a/target/linux/ramips/image/common-sercomm.mk b/target/linux/ramips/image/common-sercomm.mk new file mode 100644 index 0000000000..e96cba879c --- /dev/null +++ b/target/linux/ramips/image/common-sercomm.mk @@ -0,0 +1,87 @@ +DEVICE_VARS += SERCOMM_KERNEL_OFFSET SERCOMM_ROOTFS_OFFSET + +define Build/sercomm-crypto + $(TOPDIR)/scripts/sercomm-crypto.py \ + --input-file $@ \ + --key-file $@.key \ + --output-file $@.ser \ + --version $(SERCOMM_SWVER) + $(STAGING_DIR_HOST)/bin/openssl enc -md md5 -aes-256-cbc \ + -in $@ \ + -out $@.enc \ + -K `cat $@.key` \ + -iv 00000000000000000000000000000000 + dd if=$@.enc >> $@.ser 2>/dev/null + mv $@.ser $@ + rm -f $@.enc $@.key +endef + +define Build/sercomm-kernel + $(TOPDIR)/scripts/sercomm-kernel-header.py \ + --kernel-image $@ \ + --kernel-offset $(SERCOMM_KERNEL_OFFSET) \ + --rootfs-offset $(SERCOMM_ROOTFS_OFFSET) \ + --output-header $@.hdr + dd if=$@ >> $@.hdr 2>/dev/null + mv $@.hdr $@ +endef + +define Build/sercomm-part-tag + $(call Build/sercomm-part-tag-common,$(word 1,$(1)) $@) +endef + +define Build/sercomm-part-tag-common + $(eval file=$(word 2,$(1))) + $(TOPDIR)/scripts/sercomm-partition-tag.py \ + --input-file $(file) \ + --output-file $(file).tmp \ + --part-name $(word 1,$(1)) \ + --part-version $(SERCOMM_SWVER) + mv $(file).tmp $(file) +endef + +define Build/sercomm-payload + $(TOPDIR)/scripts/sercomm-pid.py \ + --hw-version $(SERCOMM_HWVER) \ + --hw-id $(SERCOMM_HWID) \ + --sw-version $(SERCOMM_SWVER) \ + --pid-file $@.pid \ + --extra-padding-size 0x10 \ + --extra-padding-first-byte 0x0a + $(TOPDIR)/scripts/sercomm-payload.py \ + --input-file $@ \ + --output-file $@.tmp \ + --pid "$$(cat $@.pid | od -t x1 -An -v | tr -d '\n')" + mv $@.tmp $@ + rm $@.pid +endef + +define Build/sercomm-prepend-tagged-kernel + $(CP) $(IMAGE_KERNEL) $(IMAGE_KERNEL).tagged + $(call Build/sercomm-part-tag-common,$(word 1,$(1)) \ + $(IMAGE_KERNEL).tagged) + dd if=$@ >> $(IMAGE_KERNEL).tagged 2>/dev/null + mv $(IMAGE_KERNEL).tagged $@ +endef + +define Device/sercomm_dxx + $(Device/dsa-migration) + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_SIZE := 6144k + UBINIZE_OPTS := -E 5 + LOADER_TYPE := bin + KERNEL_LOADADDR := 0x81001000 + LZMA_TEXT_START := 0x82800000 + KERNEL := kernel-bin | append-dtb | lzma | loader-kernel | lzma -a0 | \ + uImage lzma | sercomm-kernel + KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | loader-kernel | \ + lzma -a0 | uImage lzma + IMAGES += factory.img + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + IMAGE/factory.img := append-ubi | sercomm-part-tag rootfs | \ + sercomm-prepend-tagged-kernel kernel | gzip | sercomm-payload | \ + sercomm-crypto + SERCOMM_KERNEL_OFFSET := 0x400100 + SERCOMM_ROOTFS_OFFSET := 0x1000000 +endef diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index aa7adeee60..f79ba5fb5a 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -2,6 +2,7 @@ # MT7621 Profiles # +include ./common-sercomm.mk include ./common-tp-link.mk DEFAULT_SOC := mt7621 @@ -285,6 +286,19 @@ define Device/beeline_smartbox-flash endef TARGET_DEVICES += beeline_smartbox-flash +define Device/beeline_smartbox-giga + $(Device/sercomm_dxx) + IMAGE_SIZE := 24576k + SERCOMM_HWID := DBE + SERCOMM_HWVER := 10100 + SERCOMM_SWVER := 1001 + DEVICE_VENDOR := Beeline + DEVICE_MODEL := SmartBox GIGA + DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap \ + kmod-usb3 uboot-envtools +endef +TARGET_DEVICES += beeline_smartbox-giga + define Device/buffalo_wsr-1166dhp $(Device/dsa-migration) $(Device/uimage-lzma-loader) diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index 37207a52d3..0caa23feac 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -23,7 +23,8 @@ asus,rt-n56u-b1) ucidef_set_led_netdev "lan" "LAN link" "blue:lan" "br-lan" ucidef_set_led_netdev "wan" "WAN link" "blue:wan" "wan" ;; -beeline,smartbox-flash) +beeline,smartbox-flash|\ +beeline,smartbox-giga) ucidef_set_led_netdev "wan" "wan" "blue:wan" "wan" ;; cudy,wr2100) diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index 29336bad68..8abee198a5 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -42,6 +42,7 @@ ramips_setup_interfaces() ;; asiarf,ap7621-nv1|\ beeline,smartbox-flash|\ + beeline,smartbox-giga|\ glinet,gl-mt1300|\ iptime,a3002mesh|\ jcg,q20|\ diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index b4dc34fbec..7d44fcf90f 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -55,6 +55,7 @@ platform_do_upgrade() { asus,rt-ac85p|\ asus,rt-ax53u|\ beeline,smartbox-flash|\ + beeline,smartbox-giga|\ dlink,dir-1960-a1|\ dlink,dir-2640-a1|\ dlink,dir-2660-a1|\ diff --git a/target/linux/ramips/mt7621/config-5.10 b/target/linux/ramips/mt7621/config-5.10 index 804dbe3edb..182da755cf 100644 --- a/target/linux/ramips/mt7621/config-5.10 +++ b/target/linux/ramips/mt7621/config-5.10 @@ -162,6 +162,7 @@ CONFIG_MTD_NAND_MTK_BMT=y CONFIG_MTD_PHYSMAP=y CONFIG_MTD_RAW_NAND=y CONFIG_MTD_ROUTERBOOT_PARTS=y +CONFIG_MTD_SERCOMM_PARTS=y CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPI_NOR_USE_VARIABLE_ERASE=y CONFIG_MTD_SPLIT_FIT_FW=y diff --git a/target/linux/ramips/mt7621/config-5.15 b/target/linux/ramips/mt7621/config-5.15 index 02d934e11b..3072a5177e 100644 --- a/target/linux/ramips/mt7621/config-5.15 +++ b/target/linux/ramips/mt7621/config-5.15 @@ -169,6 +169,7 @@ CONFIG_MTD_NAND_MTK_BMT=y CONFIG_MTD_PHYSMAP=y CONFIG_MTD_RAW_NAND=y CONFIG_MTD_ROUTERBOOT_PARTS=y +CONFIG_MTD_SERCOMM_PARTS=y CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPI_NOR_USE_VARIABLE_ERASE=y CONFIG_MTD_SPLIT_FIT_FW=y From 77d71163b2e02156e4635ef4ca1b38d939a87be0 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Sat, 2 Jul 2022 23:48:31 +0200 Subject: [PATCH 24/36] libnl: cleanup makefile - Add PKG_LICENSE_FILES. - Use SPDX. Signed-off-by: Nick Hainke --- package/libs/libnl/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/libs/libnl/Makefile b/package/libs/libnl/Makefile index db0c65c7a7..7117226d50 100644 --- a/package/libs/libnl/Makefile +++ b/package/libs/libnl/Makefile @@ -1,20 +1,20 @@ +# SPDX-License-Identifier: GPL-2.0-only # # Copyright (C) 2006-2013 OpenWrt.org # -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# include $(TOPDIR)/rules.mk PKG_NAME:=libnl PKG_VERSION:=3.5.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/thom311/libnl/releases/download/libnl$(subst .,_,$(PKG_VERSION)) PKG_HASH:=352133ec9545da76f77e70ccb48c9d7e5324d67f6474744647a7ed382b5e05fa + PKG_LICENSE:=LGPL-2.1 +PKG_LICENSE_FILES:=COPYING PKG_INSTALL:=1 PKG_FIXUP:=autoreconf From 3dbdfed2c4868afb346ded7f6f75e8de9f4788ee Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Sun, 3 Jul 2022 00:37:57 +0200 Subject: [PATCH 25/36] libnl: update to 3.6.0 Remove upstreamed patch: - 100-build-add-Libs.private-field-in-libnl-pkg-config-file.patch cacaa5f libnl-3.6.0 release 855c02f route/mdb: merge branch 'troglobit:mdb-dump-fixes' 930fc11 route/mdb: add support for MAC multicast entries 2d68caf route/mdb: add missing detils and stats dump callbacks d9ed99b nl-monitor: support for setting libnl debug level 4c41e0d nl-monitor: add missing --help to long_opts[] 7e96356 Check validation type against end of enum 4e153bc route/link: add VLAN bridge binding flag b7256d3 github: build unit tests also with "clang" 8111933 route: assert that "rtnl_link_info_ops" refcount does not drop below zero 4f5c846 lib: merge branch 'th/object-clone-fixes' d23fb81 lib: make nl_object_clone() out-of-memory safe 7f7452c route: fix ref counting for l_info_ops and io_clone() 620d024 route: drop unnecessary oo_clone() implementation from netconf 93a02eb netfilter: make log-msg,queue-msg setters robust against ENOMEM 23902d0 xfrm/sa: clone user_offload in xfrm_sa_clone() 29e5092 xfrm/sa: style cleanup xfrm_sa_clone() 14a9ebc utils: add internal _nl_memdup() helper 2e0d7f8 lib: add rtnl_link_info_ops_get() and take lock for rtnl_link_info_ops's io_refcnt e884286 lib: include in 7d43191 tests: merge branch 'th/tests-netns' a7bbdab tests: add unit test for nl_object_clone() and nl_object_diff() fdb0121 tests: add new "netns" test suite 9102872 tests: add fixture/teardown for tests to run in separate netns 9a42798 tests: cleanup creating test suites 1fc3e07 tests: refactor tests and add n-test-util helper library 7a3d6e2 netlink: add _NL_N_ELEMENTS() macro 3da4f7d netlink: add _nl_streq()/_nl_streq0() helper 1ad8555 netlink: add _nl_auto_nl_socket cleanup macro c8a5729 lib: add _nl_close() helper 80868e6 clang-format: add ".clang-format" from linux kernel 2782ed3 github: build tests with "-std=gnu11" af59b9a github: split tests in separate steps c8f7902 build: add "check-progs" make target to build unit tests 23b4d33 route/cls: add TCA_FLOWER_KEY_VLAN_ETH_TYPE to "flower_policy" policy 1f8dc89 route/cls: return -NLE_INVAL in case rtnl_tc_data_peek() fails ef5f3eb route/cls: merge branch 'westermo:cls-flower' c385c84 route/cls: no need to copy simple fields in flower_clone() 79217d8 route/cls: make output pointers in rtnl_flower_get_{src,dst}_mac() optional 64e0836 route/cls: adjust whitspace/indentation 5ac9ce3 route/cls: use SPDX-License-Identifier 1a1c4e5 route/cls: reorder fields in "struct rtnl_flower" and adjust indentation ef46de1 route/cls: add flower classifier f0aad20 route: merge branch 'pugo:master' d0cfecc route: make argument of rtnl_link_can_set_{bittiming,data_bittiming}() const 6a92268 route: add rtnl_link_can_set_data_bittiming_const() 841553b route: drop bitrate,sample-point getters/setters from can link 37998f7 route: rename rtnl_link_can_get_data_bt_const() to rtnl_link_can_get_data_bittiming_const() 96d3a6b route: fix adding rtnl_link_can_* symbols to symbol file 881e329 route: fix indentation 37c10ef route/link: add CAN FD support d56bf73 route/mdb: merge branch 'rubensfig:mdb' e0b2406 route/mdb: drop setting ifindex in mdb_clone() d78a6eb route/mdb: minor cleanup in "mdb.c" 57a6d51 route/mdb: drop extra MDB attributes and rework mdb_compare() 0b44562 route/mdb: hide rtnl_mdb_entry_alloc() from public API 1c65ff7 route/mdb: reorder fields in "rtnl_mdb_entry" for tighther packing 1ac5403 route/mdb: use nl_list_for_each_entry_safe() for destroying list in mdb_free_data() 92035e2 route/mdb: cleanup mdb.h header 6237621 build: sort file names in Makefile.am 0ec6c6c mdb: support bridge multicast database notification c980034 route/cls: merge branch 'westermo:classifier-api-extension' a694c33 route/cls: rename rtnl_cls_get{,_by_prio}() API to rtnl_cls_find_by{handle,prio}() 88a5138 route/cls: allow fetching of classifiers from cache 90577b5 route: merge branch 'TummyFish:master' 299f61a license: use SPDX license identifiers and drop license comments 05a540d ip6vti: Add fwmark API 41e4365 ip6gre: Add fwmark API ebc7df3 sit: Add fwmark API 8e1da8e ipip: Add fwmark API bda19be ip6_tnl: Add fwmark API cdc6c0f ipvti: Add fwmark API 2995710 ipgre: Add fwmark API d9dc6c2 ip6vti: Add IPv6 VTI support be86170 license: use SPDX license identifiers and drop license comments 919d9c6 route: merge branch 'westermo:fib-lookup' 1ff9b38 route/route: don't report failure when we receive a route in rtnl_route_lookup() 53bc27e route/route: support FIB lookups using rtnl ed76b9a build: sort files in Makefile.am 46b22c1 route/link: merge branch 'westermo:team-support' 586a6b6 build: fix new symbols in "libnl-route-3.sym" 831f125 route/link: add support for team device 6c59580 route/link: Move LINK_ATTR_IFNAME to a proper location f77cd25 route/netconf: full API export f59f443 build: add Libs.private field in libnl pkg-config file b3333e0 route/qdisc: allow fetching qdiscs by their kind 9a39188 netlink: merge branch 'michael-dev:feature/nflog-vlan-v3' a93fc5f nflog: add recent missing symbols to "libnl-nf-3.sym" 7b4df53 nflog: add missing symbols to "libnl-nf-3.sym" 8266436 nflog:add conntrack flag and enable flags for nflog 246904d nflog: add CT support 59fc1d7 nflog: add mac_header support c268c48 nflog: add vlan attribute 2548468 refresh linux/netfilter/nfnetlink_log.h with linux 5.4 4edffbd route/link: Add IPv6 GRE support 5d69587 route: add global sectin in "libnl-route-3.sym" d0cf3a9 neigh: support to add fdb entry 3bf0a9c cls:u32: fix u32_clone() function 3147d86 route:tc: fix rtnl_tc_clone() calling to_clone() and add comment c027e54 route:cls: fix dangling pointers in to_clone() implementations 47c04fb route:act: drop unnecessary implementations for to_clone() 79f7c9d tests: add test for cloning cls:u32 object b1caff8 github: run unit tests under valgrind 38b3be3 tests: cleanup tests and avoid leaks c2b94b9 lib: add more _nl_auto* cleanup macros 1f05e5a tests: replace libcheck's fail_if() macro by ck_assert*() 6341d89 log: fix typo in dumping msg bfee88b route: fix memory leak of l_info_ops in link_msg_parser() 431ba83 route: merge branch 'qbdwlr:mplsPR' cc680d4 route: add accessors for setting/getting ENCAP_MPLS attributes efe8aad route: remove incorrect nl_addr_valid() from rtnl_route_nh_set_newdst(), etc. 0688bc6 netfilter/ct: fix use of reply/orig for conntrack requests 5d92516 route: don't use internal bit mask constants in NLA_PUT in can_put_attrs() 6fe9418 lib: fix descriptions for nl_cache_pickup()/nl_cache_pickup_checkdup() d0d91c7 route: merge branch 't0mmmy90:check-if-nh-exists-while-updating-ipv6-multipath-route' 28a652b route: fix duplicate check for next hop for IPv6 multipath routes 03bfd2f route: check if nh exists while updating route 92c9237 ci: add github-actions 3d1fb00 tests/check-addr: replace deprecated fail_if() macro from libcheck with ck_assert_msg() d9cad53 xfrm: fix naming consistency in xfrmnl_sp_get_curlifetime() c0e82db cli: Add C++ linkage support 000a3bd yyerror: update to POSIX standard f865a99 xfrm: merge branch 'spellingmistake:master' 0306ae2 xfrm: fix libnl-xfrm-3.sym linker versioning 8950194 xfrm: ensure minlen in policy for XFRMA_OFFLOAD_DEV c8f33a4 xfrm: Add support for xfrm user offloading b6cc13d Supporting Hardware offload capability for MACsec 39944c6 route/link: check calloc() return value 12cc0aa zero stack allocated memory in xfrmnl_build_sa_delete_request 5f39502 merge branch 'bengal/coverity' 26f342d route/qdisc: handle error of calloc() d1a151e route/qdisc: fix memory leak in netem.c aa092d1 route/link: fix copy-paste error in geneve.c 30552e8 route/cls: fix cgroup's clone() function 764c30a route: let route/link join RTNLGRP_IPV6_IFINFO mcast group b24e833 doc: update link to mscgen-filter 0b5d17d addr: merge branch 'lcrestez-dn:dadfailed' 30924e7 tests: Add test for rtnl_addr_flags2str 5c05c75 addr: Add address flag `dadfailed` 2abeec8 xfrm: remove superfluous xfrm_userpolicy_id from dump request 5611487 lib/trivial: whitespace ab015e1 lib: merge branch 'th/object-identical-fix' 36b0894 lib: allow to compare incomplete objects in nl_object_identical() 5020077 lib: let nl_object_identical() declare the same object as identical 406ebc8 lib: fix using right compare mask in nl_object_diff64() 8637c70 lib/trivial fix indentation 4be6062 route/link: avoid cloning link policy in link_msg_parser() ba3c51c route/link: fix link_msg_parser() for using the af_ops of the link family f9d0181 lib: use proper int type for id attributes in nl_object_identical() 68b3431 lib: fix documentation of nl_cache_dump_filter to have @params optional 2375cde lib: fix spelling errors in "netlink/handlers.h" 3faf26c gitignore: fix ignoring check-direct build artifacts 47fb1c0 xfrm: remove superfluous xfrm_usersa_id from dump request 846d288 travis: install "check" in travis d64a0ec route: convert non-leading tabs to spaces in "include/netlink/route/link.h" aaefd92 route: add test for valid content of map_stat_id_from_IPSTATS_MIB_v2 array bab9e77 route/link: add RTNL_LINK_REASM_OVERLAPS stat bae11ec tests: add "check-direct" test 2d50b04 route: add "netlink-private/route/utils.h" header 9a52b3d gitignore: merge all gitignore files in top level directory 4c5f2d6 merge branch 'th/license-comment-cleanup' 2d3e690 license: update "doc/COPYING" license text 1389188 license: add SPDX license identifer to "configure.ac" files 503aa5e license: fix and add SPDX license identifiers and drop license comments 4333aef license: cleanup copyright comments 956635b license: fix SPDX license identifier for nl-auto.h 5614b4c lib: merge branch 'th/cleanup-errout' 17e09aa rtnl/route: use cleanup attribute in "lib/route/link.c" b50be8f rtnl/route: use cleanup attribute in "lib/route/route_obj.c" fca338b rtnl/route: fix NLE_NOMEM handling in parse_multipath() 2957d8f rtnl/link: fix leaking rtnl_link_af_ops in link_msg_parser() 77b4f68 rtnl/route: only consider negative error codes as error 6870ece lib: cleanup nla_parse() to return early on error a858a0b lib: use _nl_strncpy*() instead of plain strncpy() 018c694 lib: cleanup _nl_strncpy_assert() e97b990 lib: rename _nl_strncpy() to _nl_strncpy_assert() 5ffbc6f lib: add _NL_RETURN_*() helper macros abb7391 lib: add "include/netlink-private/nl-auto.h" header ecd15bc lib: add _nl_assert_not_reached() 9cc38dc lib/route: adjust coding style 01ea9a6 route/link: Check for null pointer in macvlan Signed-off-by: Nick Hainke --- package/libs/libnl/Makefile | 6 ++--- ...ivate-field-in-libnl-pkg-config-file.patch | 25 ------------------- 2 files changed, 3 insertions(+), 28 deletions(-) delete mode 100644 package/libs/libnl/patches/100-build-add-Libs.private-field-in-libnl-pkg-config-file.patch diff --git a/package/libs/libnl/Makefile b/package/libs/libnl/Makefile index 7117226d50..b6eae82651 100644 --- a/package/libs/libnl/Makefile +++ b/package/libs/libnl/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnl -PKG_VERSION:=3.5.0 -PKG_RELEASE:=2 +PKG_VERSION:=3.6.0 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/thom311/libnl/releases/download/libnl$(subst .,_,$(PKG_VERSION)) -PKG_HASH:=352133ec9545da76f77e70ccb48c9d7e5324d67f6474744647a7ed382b5e05fa +PKG_HASH:=532155fd011e5a805bd67121b87a01c757e2bb24112ac17e69cb86013b970009 PKG_LICENSE:=LGPL-2.1 PKG_LICENSE_FILES:=COPYING diff --git a/package/libs/libnl/patches/100-build-add-Libs.private-field-in-libnl-pkg-config-file.patch b/package/libs/libnl/patches/100-build-add-Libs.private-field-in-libnl-pkg-config-file.patch deleted file mode 100644 index cec720b8e8..0000000000 --- a/package/libs/libnl/patches/100-build-add-Libs.private-field-in-libnl-pkg-config-file.patch +++ /dev/null @@ -1,25 +0,0 @@ -From db0d59cd06f3ffd350379847c0885e1bfb85af0f Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Sat, 7 Mar 2015 11:34:42 +0100 -Subject: [PATCH 2/2] build: add Libs.private field in libnl pkg-config file - -In order to support static linking, the libnl pkg-config file should -indicate in its Libs.private field the libraries that libnl-3.0.a -requires. The LIBS variable contains the appropriate list of -libraries: -lm in all cases, and -lpthread when pthread support is -enabled. This allows to statically link applications against libnl -properly. - -Signed-off-by: Thomas Petazzoni ---- - libnl-3.0.pc.in | 1 + - 1 file changed, 1 insertion(+) - ---- a/libnl-3.0.pc.in -+++ b/libnl-3.0.pc.in -@@ -7,4 +7,5 @@ Name: libnl - Description: Convenience library for netlink sockets - Version: @PACKAGE_VERSION@ - Libs: -L${libdir} -lnl-@MAJ_VERSION@ -+Libs.private: @LIBS@ - Cflags: -I${includedir}/libnl@MAJ_VERSION@ From 925c73aab3c1514da9f4cec97badb91113631dbf Mon Sep 17 00:00:00 2001 From: Joel Low Date: Fri, 24 Jun 2022 18:47:20 +0800 Subject: [PATCH 26/36] wolfssl: add config flag for Curve448 This enables building WolfSSL with Curve448, which can be used by Strongswan. This has been tested on a Linksys E8450, running OpenWrt 22.03-rc4. This allows parity with OpenSSL, which already supports Curve448 in OpenWrt 21.02. Fixes openwrt/packages#18812. Signed-off-by: Joel Low --- package/libs/wolfssl/Config.in | 3 +++ package/libs/wolfssl/Makefile | 2 ++ 2 files changed, 5 insertions(+) diff --git a/package/libs/wolfssl/Config.in b/package/libs/wolfssl/Config.in index eca9572c49..901f2b2965 100644 --- a/package/libs/wolfssl/Config.in +++ b/package/libs/wolfssl/Config.in @@ -51,6 +51,9 @@ config WOLFSSL_HAS_ECC25519 bool "Include ECC Curve 25519 support" default y +config WOLFSSL_HAS_ECC448 + bool "Include ECC Curve 448 support" + config WOLFSSL_HAS_OPENVPN bool "Include OpenVPN support" default y diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile index 3edd526364..a511837800 100644 --- a/package/libs/wolfssl/Makefile +++ b/package/libs/wolfssl/Makefile @@ -32,6 +32,7 @@ PKG_CONFIG_DEPENDS:=\ CONFIG_WOLFSSL_HAS_DH \ CONFIG_WOLFSSL_HAS_DTLS \ CONFIG_WOLFSSL_HAS_ECC25519 \ + CONFIG_WOLFSSL_HAS_ECC448 \ CONFIG_WOLFSSL_HAS_OCSP \ CONFIG_WOLFSSL_HAS_OPENVPN CONFIG_WOLFSSL_ALT_NAMES \ CONFIG_WOLFSSL_HAS_SESSION_TICKET \ @@ -119,6 +120,7 @@ CONFIGURE_ARGS += \ --$(if $(CONFIG_WOLFSSL_HAS_SESSION_TICKET),enable,disable)-session-ticket \ --$(if $(CONFIG_WOLFSSL_HAS_DTLS),enable,disable)-dtls \ --$(if $(CONFIG_WOLFSSL_HAS_ECC25519),enable,disable)-curve25519 \ + --$(if $(CONFIG_WOLFSSL_HAS_ECC448),enable,disable)-curve448 \ --$(if $(CONFIG_WOLFSSL_HAS_AFALG),enable,disable)-afalg \ --$(if $(CONFIG_WOLFSSL_HAS_OPENVPN),enable,disable)-openvpn \ --enable-devcrypto=$(if $(CONFIG_WOLFSSL_HAS_DEVCRYPTO_CBC),cbc\ From 8b9e806160118eb115ea26a1fbf381801185bdb6 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Mon, 27 Jun 2022 16:04:10 +0200 Subject: [PATCH 27/36] f2fs-tools: update to 1.15.0 Add patches: - 100-configure.ac-fix-AC_ARG_WITH.patch Remove upstreamed patches: - 200-resize_f2fs-fix_wrong_ovp_calculation.patch Changelog: 64f2596 f2fs-tools: upgrade version 1.15.0 d9d5b11 f2fs-tools: build silently 299c0b5 fsck.f2fs: fix broken file_map output 3af62be f2fs-tools: show segment/section layout correctly 4d9c009 f2fs-tools: use android config only if there's no config.h 0b9b89f dump.f2fs: compress: fix dstlen of LZ4_compress_fast_extState() eee3969 mkfs.f2fs: check uuid library e5fe1a2 f2fs-tools: use fsync() in Android ea9921f f2fs-tools: support zoned device in Android a8fefc2 android_config.h: add missing liblz4 0c54cf7 libf2fs_io: add unused mactor to avoid build failure 6eebd13 ci: Enable -Wall, -Wextra and -Werror c491657 Fix PowerPC format string warnings 70e4139 Suppress a compiler warning about integer truncation 7a1206a Annotate switch/case fallthrough b964b79 Change #ifdef _WIN32 checks into #ifdef HAVE_.* 28de4d1 tools/f2fs_io: Fix the type of 'ret' fdff1ab fsck/segment.c: Remove dead code ede3bde fsck/main.c: Suppress a compiler warning 93c6483 tools/f2fscrypt.c: Fix build without uuid/uuid.h header file 559e60e fsck: Remove a superfluous include directive 98f7f56 mkfs/f2fs_format.c: Suppress a compiler warning ef011a4 configure.ac: Detect selinux/android.h 2e59ab8 configure.ac: Detect the sparse/sparse.h header 1790203 Fix the MinGW build ecd27dc Use %zu to format size_t 24663b6 Include instead of defining offsetof() cdefef0 Move the be32_to_cpu() definition 1612bf9 Remove unnecessary __attribute__((packed)) annotations 7a5109f f2fs_fs.h: Use standard fixed width integer types e61203c Suppress a compiler warning 9425b47 Verify structure sizes at compile time 006bb13 Change one array member into a flexible array member cb4c5d6 ci: Build f2fstools upon push and pull requests f3033fb Change the ANDROID_WINDOWS_HOST macro into _WIN32 87d7a95 Switch from the u_int to the uint types c483354 configure.ac: Enable cross-compilation 3e97d07 configure.ac: Sort header file names alphabetically 91ba5e5 configure.ac: Enable the automake -Wall option ae65a15 configure.ac: Remove two prototype tests d24fd5c configure.ac: Stop using obsolete macros 6afcf64 libf2fs: don't allow mkfs / fsck on non power-of-2 zoned devices c7757ec man: update mkfs.f2fs to give the default android option 46e1b83 f2fs-tools: use proper 64bit types for PPC 97ce230 mkfs.f2fs: fix wrong indentation and clean up 0d3d26d mkfs.f2fs: set project quota by default for -g android for v4.14+ 1de1db8 f2fs-tools: add atomic write related options to f2fs_io write command 85cd72a mkfs.f2fs: set required quota types only 028af9f fsck.f2fs: Add progression feedback 972d710 fsck.f2fs: do not assert if i_size is missing i_blocks in symlink f63551b f2fs-tools: separate other bugs in fsck_verify ade81b9 f2fs-tools: remove false failure alarm when fixing quota 99bc497 f2fs-tools: fall back to the original version check when clock_gettime is not supported 1603a3d mkfs.f2fs: wipe other FS magics given -f 63d5004 fsck.f2fS: is_valid_summary(): check whether offset is out of bounds 3fd996c Avoid redefined ALIGN_UP 1edc138 fsck.f2fs: Update the usage about option of preen mode 49159df f2fs-tools: change fiemap print out format 8bcb58e f2fs_io: add rename w/ fsync option 9429e86 fsck.f2fs: add basic compress related check/fix 529967e f2fs-tools: make fiemap command in accordance with uapi 1228009 f2fs-tools: rebuild the quota inode if it is corrupted 9ee091e f2fs-tools: add periodic check in kernel version check 1bc7658 dump.f2fs: minor clean ups 69952e3 f2fs-tools: fix wrong value of reserve_new_block parameter in page_symlink 76d2a91 f2fs-tools: add extent cache for each file 8d464ee f2fs-tools: fix wrong file offset acd2518 fsck|dump.f2fs: add -M to get file map 027488e mkfs.f2fs: remove android features for RO e01ad31 f2fs-tools: fix metadata region overlap with zoned block device zones f3b93bf sload.f2fs: Reword "IMMUTABLE" in strings/comments 820b5e3 sload.f2fs: use F2FS_COMPRESS_RELEASED instead of IMMUTABLE bit 1d2683f f2fs-tools: support small RO partition a9594c6 fsck.f2fs: add "-l" to show the layout information 38e3115 f2fs_io: add to show immutable bit 6afd3e9 tools: Introduce f2fslabel 3218ff9 f2fs-tools: correct get kernel version logic 19d49b5 dump.f2fs: fix memory leak caused by dump_node_blk() 15d4d7b fsck.f2fs: fix memory leak caused by fsck_chk_orphan_node() 1900c22 mkfs.f2fs: fix memory leak in not enough segments error path 5cc365c resize.f2fs: fix memory leak caused by migrate_nat() 870915f f2fs_io: split definition check for crypto ioctl 91f9db2 fsck.f2fs: update kernel version in superblock on forced check 1531853 f2fs_io: Add get file name encryption mode 3bfcca8 f2fs-tool: increase debug level from 0 to 1 in migrate_block 5263ae2 resize.f2fs: fix to check free space before shrink 159752d resize.f2fs: fix wrong sit/nat bitmap during rebuild_checkpoint() 98e6463 resize.f2fs: add force option to rewrite broken calculation f056fbe resize.f2fs: fix wrong ovp calculation 80dba0f Add -P option to preserve file owner f0fda11 libf2fs: fix memory leak caused by get_rootdev() 5144f2f mkfs.f2fs: add VM disk files to hot data types 73c0871 libzoned: use blk_zone_v2 and blk_zone_report_v2 by default 9cb5150 f2fs-tools: fix wrong blk_zone_rep_v2 definition 15474db mkfs.f2fs: allocate zones together to avoid random access 316e128 mkfs.f2fs: adjust zone alignment when using multi-partitions cc57f2c fsck.f2fs: fix alignment on multi-partition support ff7172e f2fs-tools: Miscellaneous cleanup to README. 2b26417 mkfs.f2fs.8: Better document the -g argument. e05afe5 mkfs.f2fs.8: fix formatting for -l parameter in man page 747b74c f2fs-tools: Make sload.f2fs reproduce hard links b585244 f2fs-tools:sload.f2fs compression support 7b63f7b f2fs_io: add compress/decompress commands 457392a f2fs-tools: Added #ifdef WITH_func d322d47 f2fs-tools: fix a few spelling errors in f2fs-tools fcd5cd0 f2fs-tools: skipped to end on error syntax error 31d30f0 mkfs.f2fs: show a message when compression is enabled 1d4c7e7 f2fs_io: add get/set compression option 4bd7008 Fix ASSERT() macro with '%' in the expression ca0ed8a f2fs-toos: fsck.f2fs Fix bad return value c954e7c fsck.f2fs: do xnid sanity check only during fsck 1bfc173 f2fs_io: add erase option e59bb17 mkfs.f2fs.8: document the verity feature 8fd836f fsck: clear unexpected casefold flags 1a7415a mkfs.f2fs: add -h and --help 717d70d f2fs_io: change fibmap to fiemap Signed-off-by: Nick Hainke --- package/utils/f2fs-tools/Makefile | 6 +- .../100-configure.ac-fix-AC_ARG_WITH.patch | 88 +++++++++++++++++++ ...esize_f2fs-fix_wrong_ovp_calculation.patch | 46 ---------- 3 files changed, 91 insertions(+), 49 deletions(-) create mode 100644 package/utils/f2fs-tools/patches/100-configure.ac-fix-AC_ARG_WITH.patch delete mode 100644 package/utils/f2fs-tools/patches/200-resize_f2fs-fix_wrong_ovp_calculation.patch diff --git a/package/utils/f2fs-tools/Makefile b/package/utils/f2fs-tools/Makefile index 3c53f27d79..8f53516d34 100644 --- a/package/utils/f2fs-tools/Makefile +++ b/package/utils/f2fs-tools/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=f2fs-tools -PKG_VERSION:=1.14.0 -PKG_RELEASE:=3 +PKG_VERSION:=1.15.0 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/snapshot/ -PKG_HASH:=619263d4e2022152a1472c1d912eaae104f20bd227ce0bb9d41d1d6608094bd1 +PKG_HASH:=147d471040b44900283ce2c935f1d35d13d7f40008e7cb8fab2b69f54da01a4f PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0-only diff --git a/package/utils/f2fs-tools/patches/100-configure.ac-fix-AC_ARG_WITH.patch b/package/utils/f2fs-tools/patches/100-configure.ac-fix-AC_ARG_WITH.patch new file mode 100644 index 0000000000..a7fb50a63d --- /dev/null +++ b/package/utils/f2fs-tools/patches/100-configure.ac-fix-AC_ARG_WITH.patch @@ -0,0 +1,88 @@ +From 9af8ee5baceab59d46154c96da62b52935f363fe Mon Sep 17 00:00:00 2001 +From: Nick Hainke +Date: Mon, 27 Jun 2022 20:43:11 +0200 +Subject: [PATCH] configure.ac: fix AC_ARG_WITH + +In the new version the configuration no longer respects the +--without/--with blkid/selinux parameters. Add the tests for +"with_blkid" and "with_selinux" back to configure.ac as described +in the manual. + +Link: https://www.gnu.org/software/autoconf/manual/autoconf-2.60/html_node/External-Software.html + +Fixes: c48335416a09 ("configure.ac: Enable cross-compilation") + +Signed-off-by: Nick Hainke +--- + configure.ac | 44 ++++++++++++++++++++++++++++++-------------- + 1 file changed, 30 insertions(+), 14 deletions(-) + +--- a/configure.ac ++++ b/configure.ac +@@ -39,12 +39,16 @@ AM_INIT_AUTOMAKE([-Wall -Werror foreign + + # Test configure options. + AC_ARG_WITH([selinux], +- AS_HELP_STRING([--without-selinux], +- [Ignore presence of libselinux and disable selinux support])) ++ [AS_HELP_STRING([--without-selinux], ++ [Ignore presence of libselinux and disable selinux support])], ++ [], ++ [with_selinux=check]) + + AC_ARG_WITH([blkid], +- AS_HELP_STRING([--without-blkid], +- [Ignore presence of libblkid and disable blkid support])) ++ [AS_HELP_STRING([--without-blkid], ++ [Ignore presence of libblkid and disable blkid support])], ++ [], ++ [with_blkid=check]) + + # Checks for programs. + AC_PROG_CC +@@ -55,11 +59,17 @@ AC_PATH_PROG([LDCONFIG], [ldconfig], + [$PATH:/sbin]) + + # Checks for libraries. +-AC_CHECK_LIB([blkid], [blkid_probe_all], +- [AC_SUBST([libblkid_LIBS], ["-lblkid"]) +- AC_DEFINE([HAVE_LIBBLKID], [1], +- [Define if you have libblkid]) +- ], [], []) ++AS_IF([test "x$with_blkid" != xno], ++ [AC_CHECK_LIB([blkid], [blkid_probe_all], ++ [AC_SUBST([libblkid_LIBS], ["-lblkid"]) ++ AC_DEFINE([HAVE_LIBBLKID], [1], ++ [Define if you have libblkid]) ++ ], ++ [if test "x$with_blkid" != xcheck; then ++ AC_MSG_FAILURE( ++ [--with-blkid was given, but test for blkid failed]) ++ fi ++ ], -lblkid)]) + + AC_CHECK_LIB([lzo2], [main], + [AC_SUBST([liblzo2_LIBS], ["-llzo2"]) +@@ -73,11 +83,17 @@ AC_CHECK_LIB([lz4], [main], + [Define if you have liblz4]) + ], [], []) + +-AC_CHECK_LIB([selinux], [getcon], +- [AC_SUBST([libselinux_LIBS], ["-lselinux"]) +- AC_DEFINE([HAVE_LIBSELINUX], [1], +- [Define if you have libselinux]) +- ], [], []) ++AS_IF([test "x$with_selinux" != xno], ++ [AC_CHECK_LIB([selinux], [getcon], ++ [AC_SUBST([libselinux_LIBS], ["-lselinux"]) ++ AC_DEFINE([HAVE_LIBSELINUX], [1], ++ [Define if you have libselinux]) ++ ], ++ [if test "x$with_selinux" != xcheck; then ++ AC_MSG_FAILURE( ++ [--with-selinux was given, but test for selinux failed]) ++ fi ++ ], -lselinux)]) + + AC_CHECK_LIB([uuid], [uuid_clear], + [AC_SUBST([libuuid_LIBS], ["-luuid"]) diff --git a/package/utils/f2fs-tools/patches/200-resize_f2fs-fix_wrong_ovp_calculation.patch b/package/utils/f2fs-tools/patches/200-resize_f2fs-fix_wrong_ovp_calculation.patch deleted file mode 100644 index 0b433f76c4..0000000000 --- a/package/utils/f2fs-tools/patches/200-resize_f2fs-fix_wrong_ovp_calculation.patch +++ /dev/null @@ -1,46 +0,0 @@ -From f056fbeff08d30a6d9acdb9e06704461ceee3500 Mon Sep 17 00:00:00 2001 -From: Jaegeuk Kim -Date: Thu, 1 Apr 2021 20:13:55 -0700 -Subject: resize.f2fs: fix wrong ovp calculation - -beroal reported a mount failure due to broken valid_user_blocks. -[ 6890.647749] F2FS-fs (loop0): Wrong valid_user_blocks: 16040048, -user_block_count: 10016768 - -From fsck, - -segment_count_main [0x 9a95 : 39573] --> 39573 * 2MB = 78GB as user space - -overprov_segment_count [0x 4e29 : 20009] --> 20009 * 2MB = 40GB as overprovisioned space which user can't see. - -But, -[FSCK] valid_block_count matching with CP [Ok..] [0xf4c070] --> 0xf4c070 = 16040048 - -valid_block_count [0x f4c070 : 16040048] --> So, this is correct. - -It turns out resize.f2fs gave very large and wrong overprovisioning space -result in shortage of user blocks. The root cause was f2fs_get_usable_segments() -didn't consider resize case which needs segment_count_main from new superblock. - -Fixes: f8410857b7a8 ("f2fs-tools: zns zone-capacity support") -Signed-off-by: Jaegeuk Kim ---- - lib/libf2fs_zoned.c | 3 +++ - 1 file changed, 3 insertions(+) - ---- a/lib/libf2fs_zoned.c -+++ b/lib/libf2fs_zoned.c -@@ -495,6 +495,9 @@ uint32_t f2fs_get_usable_segments(struct - int i, j; - uint32_t usable_segs = 0, zone_segs; - -+ if (c.func == RESIZE) -+ return get_sb(segment_count_main); -+ - for (i = 0; i < c.ndevs; i++) { - if (c.devices[i].zoned_model != F2FS_ZONED_HM) { - usable_segs += c.devices[i].total_segments; From 353d3eafb64e06164e6b8dbfa1976659c79e04be Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Tue, 28 Jun 2022 00:46:33 +0200 Subject: [PATCH 28/36] libiconv-full: update to 1.17 Release Notes: - The libiconv library is now licensed under the LGPL version 2.1, instead of the LGPL version 2.0. The iconv program continues to be licensed under GPL version 3. - Added converters for many single-byte EBCDIC encodings: IBM-{037, 273,277,278,280,282,284,285,297,423,424,425,500,838,870,871,875}, IBM-{880,905,924,1025,1026,1047,1097,1112,1122,1123,1130,1132,1137, 1140}, IBM-{1141,1142,1143,1144,1145,1146,1147,1148,1149,1153,1154, 1155,1156,1157}, IBM-{1158,1160,1164,1165,1166,4971,12712,16804}. They are available through the configure option '--enable-extra-encodings'. Signed-off-by: Nick Hainke --- package/libs/libiconv-full/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/libs/libiconv-full/Makefile b/package/libs/libiconv-full/Makefile index e4f925a1ae..2f052aa3ed 100644 --- a/package/libs/libiconv-full/Makefile +++ b/package/libs/libiconv-full/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libiconv-full -PKG_VERSION:=1.16 +PKG_VERSION:=1.17 PKG_RELEASE:=1 PKG_SOURCE:=libiconv-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@GNU/libiconv -PKG_HASH:=e6a1b1b589654277ee790cce3734f07876ac4ccfaecbee8afa0b649cf529cc04 +PKG_HASH:=8f74213b56238c85a50a5329f77e06198771e70dd9a739779f4c02f65d971313 PKG_BUILD_DIR:=$(BUILD_DIR)/libiconv-$(PKG_VERSION) PKG_MAINTAINER:=Jo-Philipp Wich From 86b0d3b00b021375a7c9aede7a7596540c84ab80 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Sat, 25 Jun 2022 16:59:30 +0200 Subject: [PATCH 29/36] tcpdump: update to 4.99.1 Adjust - 100-tcpdump_mini.patch Remove upstreamed patches: - 101-CVE-2020-8037.patch - 102-CVE-2018-16301.patch Changelog: 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. Co-Developed-by: Ivan Pavlov Signed-off-by: Ivan Pavlov Signed-off-by: Nick Hainke --- package/network/utils/tcpdump/Makefile | 10 +- .../patches/001-remove_pcap_debug.patch | 6 +- .../tcpdump/patches/100-tcpdump_mini.patch | 699 +++++++++--------- .../tcpdump/patches/101-CVE-2020-8037.patch | 47 -- .../tcpdump/patches/102-CVE-2018-16301.patch | 101 --- 5 files changed, 359 insertions(+), 504 deletions(-) delete mode 100644 package/network/utils/tcpdump/patches/101-CVE-2020-8037.patch delete mode 100644 package/network/utils/tcpdump/patches/102-CVE-2018-16301.patch diff --git a/package/network/utils/tcpdump/Makefile b/package/network/utils/tcpdump/Makefile index f14f86e9a3..d6da50f25e 100644 --- a/package/network/utils/tcpdump/Makefile +++ b/package/network/utils/tcpdump/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=tcpdump -PKG_VERSION:=4.9.3 -PKG_RELEASE:=4 +PKG_VERSION:=4.99.1 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.tcpdump.org/release/ -PKG_HASH:=2cd47cb3d460b6ff75f4a9940f594317ad456cfbf2bd2c8e5151e16559db6410 +PKG_HASH:=79b36985fb2703146618d87c4acde3e068b91c553fb93f021a337f175fd10ebe PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause @@ -58,8 +58,8 @@ ifeq ($(BUILD_VARIANT),mini) endif define Package/tcpdump/install - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tcpdump $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tcpdump $(1)/usr/bin/ endef Package/tcpdump-mini/install = $(Package/tcpdump/install) diff --git a/package/network/utils/tcpdump/patches/001-remove_pcap_debug.patch b/package/network/utils/tcpdump/patches/001-remove_pcap_debug.patch index 3da979dd35..e79de526a1 100644 --- a/package/network/utils/tcpdump/patches/001-remove_pcap_debug.patch +++ b/package/network/utils/tcpdump/patches/001-remove_pcap_debug.patch @@ -1,8 +1,8 @@ --- a/configure +++ b/configure -@@ -6183,97 +6183,6 @@ $as_echo "no" >&6; } - fi - fi +@@ -6230,97 +6230,6 @@ fi + + -# -# Check for special debugging functions diff --git a/package/network/utils/tcpdump/patches/100-tcpdump_mini.patch b/package/network/utils/tcpdump/patches/100-tcpdump_mini.patch index 17477d2799..ad7c3feb4e 100644 --- a/package/network/utils/tcpdump/patches/100-tcpdump_mini.patch +++ b/package/network/utils/tcpdump/patches/100-tcpdump_mini.patch @@ -1,13 +1,14 @@ --- a/Makefile.in +++ b/Makefile.in -@@ -72,6 +72,80 @@ DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@ +@@ -73,6 +73,85 @@ DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@ - CSRC = setsignal.c tcpdump.c + CSRC = fptype.c tcpdump.c +ifdef TCPDUMP_MINI + +LIBNETDISSECT_SRC=\ + netdissect.c \ ++ netdissect-alloc.c \ + addrtoname.c \ + addrtostr.c \ + af.c \ @@ -15,17 +16,18 @@ + checksum.c \ + cpack.c \ + gmpls.c \ -+ gmt2local.c \ + in_cksum.c \ + ipproto.c \ + l2vpn.c \ + machdep.c \ ++ ntp.c \ + nlpid.c \ + oui.c \ + parsenfsfh.c \ + print.c \ + print-802_11.c \ + print-aodv.c \ ++ print-arista.c \ + print-arp.c \ + print-ascii.c \ + print-bootp.c \ @@ -39,6 +41,7 @@ + print-icmp.c \ + print-icmp6.c \ + print-igmp.c \ ++ print-ip-demux.c \ + print-ip.c \ + print-ip6.c \ + print-ip6opts.c \ @@ -47,6 +50,7 @@ + print-llc.c \ + print-lldp.c \ + print-loopback.c \ ++ print-macsec.c \ + print-nfs.c \ + print-ntp.c \ + print-null.c \ @@ -72,6 +76,7 @@ + print-telnet.c \ + print-tftp.c \ + print-udp.c \ ++ print-unsupported.c \ + signature.c \ + strtoaddr.c \ + util-print.c @@ -81,19 +86,19 @@ LIBNETDISSECT_SRC=\ addrtoname.c \ addrtostr.c \ -@@ -237,6 +311,8 @@ LIBNETDISSECT_SRC=\ +@@ -252,6 +331,8 @@ LIBNETDISSECT_SRC=\ strtoaddr.c \ util-print.c +endif + LOCALSRC = @LOCALSRC@ - GENSRC = version.c LIBOBJS = @LIBOBJS@ + --- a/addrtoname.c +++ b/addrtoname.c -@@ -578,8 +578,10 @@ linkaddr_string(netdissect_options *ndo, - if (type == LINKADDR_ETHER && len == ETHER_ADDR_LEN) +@@ -683,8 +683,10 @@ linkaddr_string(netdissect_options *ndo, + if (type == LINKADDR_ETHER && len == MAC_ADDR_LEN) return (etheraddr_string(ndo, ep)); +#ifndef TCPDUMP_MINI @@ -103,7 +108,7 @@ tp = lookup_bytestring(ndo, ep, len); if (tp->bs_name) -@@ -1214,6 +1216,7 @@ init_addrtoname(netdissect_options *ndo, +@@ -1263,6 +1265,7 @@ init_addrtoname(netdissect_options *ndo, init_ipxsaparray(ndo); } @@ -111,7 +116,7 @@ const char * dnaddr_string(netdissect_options *ndo, u_short dnaddr) { -@@ -1230,6 +1233,7 @@ dnaddr_string(netdissect_options *ndo, u +@@ -1279,6 +1282,7 @@ dnaddr_string(netdissect_options *ndo, u return(tp->name); } @@ -119,138 +124,45 @@ /* Return a zero'ed hnamemem struct and cuts down on calloc() overhead */ struct hnamemem * ---- a/print.c -+++ b/print.c -@@ -48,6 +48,7 @@ static const struct printer printers[] = - #ifdef DLT_IPNET - { ipnet_if_print, DLT_IPNET }, - #endif -+#ifndef TCPDUMP_MINI - #ifdef DLT_IEEE802_15_4 - { ieee802_15_4_if_print, DLT_IEEE802_15_4 }, - #endif -@@ -57,12 +58,14 @@ static const struct printer printers[] = - #ifdef DLT_PPI - { ppi_if_print, DLT_PPI }, - #endif -+#endif - #ifdef DLT_NETANALYZER - { netanalyzer_if_print, DLT_NETANALYZER }, - #endif - #ifdef DLT_NETANALYZER_TRANSPARENT - { netanalyzer_transparent_if_print, DLT_NETANALYZER_TRANSPARENT }, - #endif -+#ifndef TCPDUMP_MINI - #if defined(DLT_NFLOG) && defined(HAVE_PCAP_NFLOG_H) - { nflog_if_print, DLT_NFLOG}, - #endif -@@ -75,10 +78,12 @@ static const struct printer printers[] = - #ifdef DLT_IP_OVER_FC - { ipfc_if_print, DLT_IP_OVER_FC }, - #endif -+#endif - { null_if_print, DLT_NULL }, - #ifdef DLT_LOOP - { null_if_print, DLT_LOOP }, - #endif -+#ifndef TCPDUMP_MINI - #ifdef DLT_APPLE_IP_OVER_IEEE1394 - { ap1394_if_print, DLT_APPLE_IP_OVER_IEEE1394 }, - #endif -@@ -92,7 +97,9 @@ static const struct printer printers[] = - #ifdef DLT_ARCNET_LINUX - { arcnet_linux_if_print, DLT_ARCNET_LINUX }, - #endif -+#endif - { raw_if_print, DLT_RAW }, -+#ifndef TCPDUMP_MINI - #ifdef DLT_IPV4 - { raw_if_print, DLT_IPV4 }, - #endif -@@ -116,17 +123,21 @@ static const struct printer printers[] = - #ifdef DLT_HDLC - { chdlc_if_print, DLT_HDLC }, - #endif -+#endif - #ifdef DLT_PPP_ETHER - { pppoe_if_print, DLT_PPP_ETHER }, - #endif -+#ifndef TCPDUMP_MINI - #if defined(DLT_PFLOG) && defined(HAVE_NET_IF_PFLOG_H) - { pflog_if_print, DLT_PFLOG }, - #endif - { token_if_print, DLT_IEEE802 }, - { fddi_if_print, DLT_FDDI }, -+#endif - #ifdef DLT_LINUX_SLL - { sll_if_print, DLT_LINUX_SLL }, - #endif -+#ifndef TCPDUMP_MINI - #ifdef DLT_FR - { fr_if_print, DLT_FR }, - #endif -@@ -198,6 +209,7 @@ static const struct printer printers[] = - #ifdef DLT_PKTAP - { pktap_if_print, DLT_PKTAP }, - #endif -+#endif - #ifdef DLT_IEEE802_11_RADIO - { ieee802_11_radio_if_print, DLT_IEEE802_11_RADIO }, - #endif -@@ -214,12 +226,14 @@ static const struct printer printers[] = - #ifdef DLT_PPP_WITHDIRECTION - { ppp_if_print, DLT_PPP_WITHDIRECTION }, - #endif -+#ifndef TCPDUMP_MINI - #ifdef DLT_PPP_BSDOS - { ppp_bsdos_if_print, DLT_PPP_BSDOS }, - #endif - #ifdef DLT_PPP_SERIAL - { ppp_hdlc_if_print, DLT_PPP_SERIAL }, - #endif -+#endif - { NULL, 0 }, - }; - --- a/print-ether.c +++ b/print-ether.c -@@ -342,6 +342,7 @@ ethertype_print(netdissect_options *ndo, - arp_print(ndo, p, length, caplen); +@@ -539,6 +539,7 @@ ethertype_print(netdissect_options *ndo, + arp_print(ndo, p, length, caplen); return (1); +#ifndef TCPDUMP_MINI case ETHERTYPE_DN: decnet_print(ndo, p, length, caplen); return (1); -@@ -368,6 +369,7 @@ ethertype_print(netdissect_options *ndo, - } +@@ -569,6 +570,7 @@ ethertype_print(netdissect_options *ndo, + ND_TCHECK_LEN(p, 1); isoclns_print(ndo, p + 1, length - 1); return(1); +#endif case ETHERTYPE_PPPOED: case ETHERTYPE_PPPOES: -@@ -380,9 +382,11 @@ ethertype_print(netdissect_options *ndo, - eap_print(ndo, p, length); +@@ -581,9 +583,11 @@ ethertype_print(netdissect_options *ndo, + eapol_print(ndo, p); return (1); +#ifndef TCPDUMP_MINI case ETHERTYPE_RRCP: - rrcp_print(ndo, p, length, src, dst); + rrcp_print(ndo, p, length, src, dst); return (1); +#endif case ETHERTYPE_PPP: if (length) { -@@ -391,6 +395,7 @@ ethertype_print(netdissect_options *ndo, +@@ -592,6 +596,7 @@ ethertype_print(netdissect_options *ndo, } return (1); +#ifndef TCPDUMP_MINI case ETHERTYPE_MPCP: - mpcp_print(ndo, p, length); + mpcp_print(ndo, p, length); return (1); -@@ -403,6 +408,7 @@ ethertype_print(netdissect_options *ndo, +@@ -604,19 +609,23 @@ ethertype_print(netdissect_options *ndo, case ETHERTYPE_CFM_OLD: cfm_print(ndo, p, length); return (1); @@ -258,17 +170,25 @@ case ETHERTYPE_LLDP: lldp_print(ndo, p, length); -@@ -412,6 +418,7 @@ ethertype_print(netdissect_options *ndo, + return (1); + ++#ifndef TCPDUMP_MINI + case ETHERTYPE_NSH: + nsh_print(ndo, p, length); + return (1); ++#endif + + case ETHERTYPE_LOOPBACK: loopback_print(ndo, p, length); - return (1); + return (1); +#ifndef TCPDUMP_MINI case ETHERTYPE_MPLS: case ETHERTYPE_MPLS_MULTI: mpls_print(ndo, p, length); -@@ -441,6 +448,7 @@ ethertype_print(netdissect_options *ndo, - case ETHERTYPE_MEDSA: - medsa_print(ndo, p, length, caplen, src, dst); +@@ -646,6 +655,7 @@ ethertype_print(netdissect_options *ndo, + case ETHERTYPE_PTP: + ptp_print(ndo, p, length); return (1); +#endif @@ -276,7 +196,7 @@ case ETHERTYPE_SCA: --- a/print-gre.c +++ b/print-gre.c -@@ -216,6 +216,7 @@ gre_print_0(netdissect_options *ndo, con +@@ -207,6 +207,7 @@ gre_print_0(netdissect_options *ndo, con case ETHERTYPE_IPV6: ip6_print(ndo, bp, len); break; @@ -284,104 +204,63 @@ case ETHERTYPE_MPLS: mpls_print(ndo, bp, len); break; -@@ -231,6 +232,7 @@ gre_print_0(netdissect_options *ndo, con - case ETHERTYPE_TEB: - ether_print(ndo, bp, len, ndo->ndo_snapend - bp, NULL, NULL); +@@ -219,6 +220,7 @@ gre_print_0(netdissect_options *ndo, con + case ETHERTYPE_GRE_ISO: + isoclns_print(ndo, bp, len); break; +#endif - default: - ND_PRINT((ndo, "gre-proto-0x%x", prot)); - } + case ETHERTYPE_TEB: + ether_print(ndo, bp, len, ND_BYTES_AVAILABLE_AFTER(bp), NULL, NULL); + break; +--- a/print-icmp6.c ++++ b/print-icmp6.c +@@ -1384,7 +1384,7 @@ get_upperlayer(netdissect_options *ndo, + nh = GET_U_1(fragh->ip6f_nxt); + hlen = sizeof(struct ip6_frag); + break; +- ++#ifndef TCPDUMP_MINI + case IPPROTO_AH: + ah = (const struct ah *)bp; + if (!ND_TTEST_1(ah->ah_len)) +@@ -1392,7 +1392,7 @@ get_upperlayer(netdissect_options *ndo, + nh = GET_U_1(ah->ah_nxt); + hlen = (GET_U_1(ah->ah_len) + 2) << 2; + break; +- ++#endif + default: /* unknown or undecodable header */ + *prot = nh; /* meaningless, but set here anyway */ + return(NULL); --- a/print-igmp.c +++ b/print-igmp.c -@@ -306,6 +306,7 @@ igmp_print(netdissect_options *ndo, - ND_TCHECK2(bp[4], 4); - ND_PRINT((ndo, "igmp leave %s", ipaddr_string(ndo, &bp[4]))); +@@ -269,6 +269,7 @@ igmp_print(netdissect_options *ndo, + case 0x17: + ND_PRINT("igmp leave %s", GET_IPADDR_STRING(bp + 4)); break; +#ifndef TCPDUMP_MINI case 0x13: - ND_PRINT((ndo, "igmp dvmrp")); + ND_PRINT("igmp dvmrp"); if (len < 8) -@@ -317,6 +318,7 @@ igmp_print(netdissect_options *ndo, - ND_PRINT((ndo, "igmp pimv1")); +@@ -280,6 +281,7 @@ igmp_print(netdissect_options *ndo, + ND_PRINT("igmp pimv1"); pimv1_print(ndo, bp, len); break; +#endif case 0x1e: - print_mresp(ndo, bp, len); + print_mtrace(ndo, "mresp", bp, len); break; ---- a/print-ip6.c -+++ b/print-ip6.c -@@ -305,6 +305,7 @@ ip6_print(netdissect_options *ndo, const - return; - nh = *cp; - break; -+#ifndef TCPDUMP_MINI - case IPPROTO_FRAGMENT: - advance = frag6_print(ndo, cp, (const u_char *)ip6); - if (advance < 0 || ndo->ndo_snapend <= cp + advance) -@@ -328,6 +329,7 @@ ip6_print(netdissect_options *ndo, const - return; - nh = *cp; - return; -+#endif - case IPPROTO_ROUTING: - ND_TCHECK(*cp); - advance = rt6_print(ndo, cp, (const u_char *)ip6); -@@ -335,12 +337,14 @@ ip6_print(netdissect_options *ndo, const - return; - nh = *cp; - break; -+#ifndef TCPDUMP_MINI - case IPPROTO_SCTP: - sctp_print(ndo, cp, (const u_char *)ip6, len); - return; - case IPPROTO_DCCP: - dccp_print(ndo, cp, (const u_char *)ip6, len); - return; -+#endif - case IPPROTO_TCP: - tcp_print(ndo, cp, len, (const u_char *)ip6, fragmented); - return; -@@ -350,6 +354,7 @@ ip6_print(netdissect_options *ndo, const - case IPPROTO_ICMPV6: - icmp6_print(ndo, cp, len, (const u_char *)ip6, fragmented); - return; -+#ifndef TCPDUMP_MINI - case IPPROTO_AH: - advance = ah_print(ndo, cp); - if (advance < 0) -@@ -382,6 +387,7 @@ ip6_print(netdissect_options *ndo, const - case IPPROTO_PIM: - pim_print(ndo, cp, len, (const u_char *)ip6); - return; -+#endif - - case IPPROTO_OSPF: - ospf6_print(ndo, cp, len); -@@ -395,9 +401,11 @@ ip6_print(netdissect_options *ndo, const - ip_print(ndo, cp, len); - return; - -+#ifndef TCPDUMP_MINI - case IPPROTO_PGM: - pgm_print(ndo, cp, len, (const u_char *)ip6); - return; -+#endif - - case IPPROTO_GRE: - gre_print(ndo, cp, len); ---- a/print-ip.c -+++ b/print-ip.c -@@ -344,6 +344,7 @@ ip_print_demux(netdissect_options *ndo, +--- a/print-ip-demux.c ++++ b/print-ip-demux.c +@@ -48,6 +48,7 @@ ip_demux_print(netdissect_options *ndo, again: - switch (ipds->nh) { + switch (nh) { +#ifndef TCPDUMP_MINI case IPPROTO_AH: - if (!ND_TTEST(*ipds->cp)) { - ND_PRINT((ndo, "[|AH]")); -@@ -382,7 +383,9 @@ again: + if (!ND_TTEST_1(bp)) { + ndo->ndo_protocol = "ah"; +@@ -85,7 +86,9 @@ again: */ break; } @@ -389,61 +268,94 @@ +#ifndef TCPDUMP_MINI case IPPROTO_SCTP: - sctp_print(ndo, ipds->cp, (const u_char *)ipds->ip, ipds->len); + sctp_print(ndo, bp, iph, length); break; -@@ -390,6 +393,7 @@ again: +@@ -93,7 +96,7 @@ again: case IPPROTO_DCCP: - dccp_print(ndo, ipds->cp, (const u_char *)ipds->ip, ipds->len); + dccp_print(ndo, bp, iph, length); break; +- +#endif - case IPPROTO_TCP: - /* pass on the MF bit plus the offset to detect fragments */ -@@ -409,6 +413,7 @@ again: - ipds->off & (IP_MF|IP_OFFMASK)); + tcp_print(ndo, bp, length, iph, fragmented); + break; +@@ -122,6 +125,7 @@ again: + } break; +#ifndef TCPDUMP_MINI case IPPROTO_PIGP: /* * XXX - the current IANA protocol number assignments -@@ -429,14 +434,17 @@ again: +@@ -142,14 +146,17 @@ again: case IPPROTO_EIGRP: - eigrp_print(ndo, ipds->cp, ipds->len); + eigrp_print(ndo, bp, length); break; +#endif case IPPROTO_ND: - ND_PRINT((ndo, " nd %d", ipds->len)); + ND_PRINT(" nd %u", length); break; +#ifndef TCPDUMP_MINI case IPPROTO_EGP: - egp_print(ndo, ipds->cp, ipds->len); + egp_print(ndo, bp, length); break; +#endif case IPPROTO_OSPF: - ospf_print(ndo, ipds->cp, ipds->len, (const u_char *)ipds->ip); -@@ -469,6 +477,7 @@ again: - gre_print(ndo, ipds->cp, ipds->len); + if (ver == 6) +@@ -186,6 +193,7 @@ again: + gre_print(ndo, bp, length); break; +#ifndef TCPDUMP_MINI case IPPROTO_MOBILE: - mobile_print(ndo, ipds->cp, ipds->len); + mobile_print(ndo, bp, length); break; -@@ -497,6 +506,7 @@ again: +@@ -205,6 +213,7 @@ again: case IPPROTO_PGM: - pgm_print(ndo, ipds->cp, ipds->len, (const u_char *)ipds->ip); + pgm_print(ndo, bp, length, iph); break; +#endif - default: - if (ndo->ndo_nflag==0 && (p_name = netdb_protoname(ipds->nh)) != NULL) + case IPPROTO_ETHERNET: + if (ver == 6) +--- a/print-ip6.c ++++ b/print-ip6.c +@@ -135,10 +135,11 @@ ip6_finddst(netdissect_options *ndo, nd_ + * Only one routing header to a customer. + */ + goto done; +- ++#ifndef TCPDUMP_MINI + case IPPROTO_AH: + case IPPROTO_ESP: + case IPPROTO_IPCOMP: ++#endif + default: + /* + * AH and ESP are, in the RFCs that describe them, +@@ -357,6 +358,7 @@ ip6_print(netdissect_options *ndo, const + nh = GET_U_1(cp); + break; + ++#ifndef TCPDUMP_MINI + case IPPROTO_FRAGMENT: + advance = frag6_print(ndo, cp, (const u_char *)ip6); + if (advance < 0 || ndo->ndo_snapend <= cp + advance) { +@@ -387,7 +389,7 @@ ip6_print(netdissect_options *ndo, const + nh = GET_U_1(cp); + nd_pop_packet_info(ndo); + return; +- ++#endif + case IPPROTO_ROUTING: + ND_TCHECK_1(cp); + advance = rt6_print(ndo, cp, (const u_char *)ip6); --- a/print-llc.c +++ b/print-llc.c -@@ -206,6 +206,7 @@ llc_print(netdissect_options *ndo, const +@@ -207,6 +207,7 @@ llc_print(netdissect_options *ndo, const hdrlen = 4; /* DSAP, SSAP, 2-byte control field */ } @@ -451,7 +363,7 @@ if (ssap_field == LLCSAP_GLOBAL && dsap_field == LLCSAP_GLOBAL) { /* * This is an Ethernet_802.3 IPX frame; it has an -@@ -228,6 +229,7 @@ llc_print(netdissect_options *ndo, const +@@ -229,6 +230,7 @@ llc_print(netdissect_options *ndo, const ipx_print(ndo, p, length); return (0); /* no LLC header */ } @@ -459,7 +371,7 @@ dsap = dsap_field & ~LLC_IG; ssap = ssap_field & ~LLC_GSAP; -@@ -291,6 +293,7 @@ llc_print(netdissect_options *ndo, const +@@ -292,6 +294,7 @@ llc_print(netdissect_options *ndo, const return (hdrlen); } @@ -467,7 +379,7 @@ if (ssap == LLCSAP_IPX && dsap == LLCSAP_IPX && control == LLC_UI) { /* -@@ -304,6 +307,7 @@ llc_print(netdissect_options *ndo, const +@@ -305,6 +308,7 @@ llc_print(netdissect_options *ndo, const ipx_print(ndo, p, length); return (hdrlen); } @@ -475,7 +387,7 @@ #ifdef ENABLE_SMB if (ssap == LLCSAP_NETBEUI && dsap == LLCSAP_NETBEUI -@@ -322,12 +326,13 @@ llc_print(netdissect_options *ndo, const +@@ -323,12 +327,13 @@ llc_print(netdissect_options *ndo, const return (hdrlen); } #endif @@ -490,15 +402,15 @@ if (!ndo->ndo_eflag) { if (ssap == dsap) { if (src == NULL || dst == NULL) -@@ -480,6 +485,7 @@ snap_print(netdissect_options *ndo, cons +@@ -484,6 +489,7 @@ snap_print(netdissect_options *ndo, cons case OUI_CISCO: switch (et) { +#ifndef TCPDUMP_MINI case PID_CISCO_CDP: - cdp_print(ndo, p, length, caplen); + cdp_print(ndo, p, length); return (1); -@@ -492,6 +498,7 @@ snap_print(netdissect_options *ndo, cons +@@ -496,6 +502,7 @@ snap_print(netdissect_options *ndo, cons case PID_CISCO_VTP: vtp_print(ndo, p, length); return (1); @@ -506,7 +418,7 @@ case PID_CISCO_PVST: case PID_CISCO_VLANBRIDGE: stp_print(ndo, p, length); -@@ -504,6 +511,7 @@ snap_print(netdissect_options *ndo, cons +@@ -508,6 +515,7 @@ snap_print(netdissect_options *ndo, cons case OUI_RFC2684: switch (et) { @@ -514,7 +426,7 @@ case PID_RFC2684_ETH_FCS: case PID_RFC2684_ETH_NOFCS: /* -@@ -565,6 +573,7 @@ snap_print(netdissect_options *ndo, cons +@@ -569,6 +577,7 @@ snap_print(netdissect_options *ndo, cons */ fddi_print(ndo, p, length, caplen); return (1); @@ -542,25 +454,25 @@ /* unknown AF_ value */ --- a/print-ppp.c +++ b/print-ppp.c -@@ -1367,6 +1367,7 @@ trunc: - return 0; - } - +@@ -1355,6 +1355,7 @@ trunc: + * The length argument is the on-the-wire length, not the captured + * length; we can only un-escape the captured part. + */ +#ifndef TCPDUMP_MINI static void ppp_hdlc(netdissect_options *ndo, - const u_char *p, int length) -@@ -1445,6 +1446,7 @@ trunc: - free(b); - ND_PRINT((ndo, "[|ppp]")); + const u_char *p, u_int length) +@@ -1440,17 +1441,19 @@ trunc: + ndo->ndo_snapend = se; + nd_print_trunc(ndo); } +- +#endif - /* PPP */ -@@ -1452,10 +1454,12 @@ static void + static void handle_ppp(netdissect_options *ndo, - u_int proto, const u_char *p, int length) + u_int proto, const u_char *p, u_int length) { +#ifndef TCPDUMP_MINI if ((proto & 0xff00) == 0x7e00) { /* is this an escape code ? */ @@ -571,7 +483,7 @@ switch (proto) { case PPP_LCP: /* fall through */ -@@ -1488,6 +1492,7 @@ handle_ppp(netdissect_options *ndo, +@@ -1483,6 +1486,7 @@ handle_ppp(netdissect_options *ndo, case PPP_IPV6: ip6_print(ndo, p, length); break; @@ -579,33 +491,30 @@ case ETHERTYPE_IPX: /*XXX*/ case PPP_IPX: ipx_print(ndo, p, length); -@@ -1499,6 +1504,7 @@ handle_ppp(netdissect_options *ndo, +@@ -1494,6 +1498,7 @@ handle_ppp(netdissect_options *ndo, case PPP_MPLS_MCAST: mpls_print(ndo, p, length); break; +#endif case PPP_COMP: - ND_PRINT((ndo, "compressed PPP data")); + ND_PRINT("compressed PPP data"); break; -@@ -1639,6 +1645,7 @@ ppp_if_print(netdissect_options *ndo, - return (0); +@@ -1634,6 +1639,7 @@ ppp_if_print(netdissect_options *ndo, + ppp_print(ndo, p, length); } +#ifndef TCPDUMP_MINI /* * PPP I/F printer to use if we know that RFC 1662-style PPP in HDLC-like * framing, or Cisco PPP with HDLC framing as per section 4.3.1 of RFC 1547, -@@ -1866,6 +1873,7 @@ printx: +@@ -1877,3 +1883,4 @@ printx: #endif /* __bsdi__ */ - return (hdrlength); + ndo->ndo_ll_hdr_len += hdrlength; } +#endif - - - /* --- a/print-sll.c +++ b/print-sll.c -@@ -249,12 +249,14 @@ recurse: +@@ -460,12 +460,14 @@ recurse: */ switch (ether_type) { @@ -622,22 +531,24 @@ /* --- a/print-tcp.c +++ b/print-tcp.c -@@ -589,12 +589,14 @@ tcp_print(netdissect_options *ndo, - ND_PRINT((ndo, " %u", utoval)); +@@ -612,6 +612,7 @@ tcp_print(netdissect_options *ndo, + ND_PRINT(" %u", utoval); break; +#ifndef TCPDUMP_MINI case TCPOPT_MPTCP: - datalen = len - 2; - LENCHECK(datalen); - if (!mptcp_print(ndo, cp-2, len, flags)) + { + const u_char *snapend_save; +@@ -635,7 +636,7 @@ tcp_print(netdissect_options *ndo, goto bad; break; + } +- +#endif - case TCPOPT_FASTOPEN: datalen = len - 2; -@@ -670,6 +672,7 @@ tcp_print(netdissect_options *ndo, + LENCHECK(datalen); +@@ -720,6 +721,7 @@ tcp_print(netdissect_options *ndo, return; } @@ -645,7 +556,7 @@ if (ndo->ndo_packettype) { switch (ndo->ndo_packettype) { case PT_ZMTP1: -@@ -681,28 +684,36 @@ tcp_print(netdissect_options *ndo, +@@ -735,6 +737,7 @@ tcp_print(netdissect_options *ndo, } return; } @@ -653,11 +564,12 @@ if (IS_SRC_OR_DST_PORT(TELNET_PORT)) { telnet_print(ndo, bp, length); - } else if (IS_SRC_OR_DST_PORT(SMTP_PORT)) { - ND_PRINT((ndo, ": ")); - smtp_print(ndo, bp, length); +@@ -745,24 +748,31 @@ tcp_print(netdissect_options *ndo, + ND_PRINT(": "); + ndo->ndo_protocol = "whois"; /* needed by txtproto_print() */ + txtproto_print(ndo, bp, length, NULL, 0); /* RFC 3912 */ - } else if (IS_SRC_OR_DST_PORT(BGP_PORT)) -+ } ++ } +#ifndef TCPDUMP_MINI + else if (IS_SRC_OR_DST_PORT(BGP_PORT)) bgp_print(ndo, bp, length); @@ -667,12 +579,14 @@ +#ifndef TCPDUMP_MINI else if (IS_SRC_OR_DST_PORT(REDIS_PORT)) resp_print(ndo, bp, length); + else if (IS_SRC_OR_DST_PORT(SSH_PORT)) + ssh_print(ndo, bp, length); +#endif #ifdef ENABLE_SMB else if (IS_SRC_OR_DST_PORT(NETBIOS_SSN_PORT)) nbt_tcp_print(ndo, bp, length); - else if (IS_SRC_OR_DST_PORT(SMB_PORT)) - smb_tcp_print(ndo, bp, length); + else if (IS_SRC_OR_DST_PORT(SMB_PORT)) + smb_tcp_print(ndo, bp, length); #endif +#ifndef TCPDUMP_MINI else if (IS_SRC_OR_DST_PORT(BEEP_PORT)) @@ -681,41 +595,40 @@ openflow_print(ndo, bp, length); +#endif else if (IS_SRC_OR_DST_PORT(FTP_PORT)) { - ND_PRINT((ndo, ": ")); + ND_PRINT(": "); ftp_print(ndo, bp, length); -@@ -725,6 +736,7 @@ tcp_print(netdissect_options *ndo, - * XXX packet could be unaligned, it can go strange - */ - ns_print(ndo, bp + 2, length - 2, 0); +@@ -775,12 +785,14 @@ tcp_print(netdissect_options *ndo, + } else if (IS_SRC_OR_DST_PORT(NAMESERVER_PORT)) { + /* over_tcp: TRUE, is_mdns: FALSE */ + domain_print(ndo, bp, length, TRUE, FALSE); +#ifndef TCPDUMP_MINI } else if (IS_SRC_OR_DST_PORT(MSDP_PORT)) { msdp_print(ndo, bp, length); } else if (IS_SRC_OR_DST_PORT(RPKI_RTR_PORT)) { -@@ -732,6 +744,7 @@ tcp_print(netdissect_options *ndo, - } - else if (length > 0 && (IS_SRC_OR_DST_PORT(LDP_PORT))) { + rpki_rtr_print(ndo, bp, length); + } else if (IS_SRC_OR_DST_PORT(LDP_PORT)) { ldp_print(ndo, bp, length); +#endif - } - else if ((IS_SRC_OR_DST_PORT(NFS_PORT)) && - length >= 4 && ND_TTEST2(*bp, 4)) { + } else if ((IS_SRC_OR_DST_PORT(NFS_PORT)) && + length >= 4 && ND_TTEST_4(bp)) { + /* --- a/print-udp.c +++ b/print-udp.c -@@ -430,10 +430,12 @@ udp_print(netdissect_options *ndo, regis - vat_print(ndo, (const void *)(up + 1), up); +@@ -435,10 +435,12 @@ udp_print(netdissect_options *ndo, const + vat_print(ndo, cp, length); break; +#ifndef TCPDUMP_MINI case PT_WB: udpipaddr_print(ndo, ip, sport, dport); - wb_print(ndo, (const void *)(up + 1), length); + wb_print(ndo, cp, length); break; +#endif case PT_RPC: - rp = (const struct sunrpc_msg *)(up + 1); -@@ -462,10 +464,12 @@ udp_print(netdissect_options *ndo, regis - snmp_print(ndo, (const u_char *)(up + 1), length); + rp = (const struct sunrpc_msg *)cp; +@@ -467,10 +469,12 @@ udp_print(netdissect_options *ndo, const + snmp_print(ndo, cp, length); break; +#ifndef TCPDUMP_MINI @@ -727,131 +640,221 @@ case PT_TFTP: udpipaddr_print(ndo, ip, sport, dport); -@@ -483,6 +487,7 @@ udp_print(netdissect_options *ndo, regis +@@ -488,6 +492,7 @@ udp_print(netdissect_options *ndo, const radius_print(ndo, cp, length); break; +#ifndef TCPDUMP_MINI case PT_VXLAN: udpipaddr_print(ndo, ip, sport, dport); - vxlan_print(ndo, (const u_char *)(up + 1), length); -@@ -497,6 +502,7 @@ udp_print(netdissect_options *ndo, regis + vxlan_print(ndo, cp, length); +@@ -510,6 +515,7 @@ udp_print(netdissect_options *ndo, const udpipaddr_print(ndo, ip, sport, dport); - lmp_print(ndo, cp, length); + someip_print(ndo, cp, length); break; +#endif - } - return; - } -@@ -574,31 +580,40 @@ udp_print(netdissect_options *ndo, regis - ns_print(ndo, (const u_char *)(up + 1), length, 0); + case PT_DOMAIN: + udpipaddr_print(ndo, ip, sport, dport); + /* over_tcp: FALSE, is_mdns: FALSE */ +@@ -596,29 +602,37 @@ udp_print(netdissect_options *ndo, const else if (IS_SRC_OR_DST_PORT(MULTICASTDNS_PORT)) - ns_print(ndo, (const u_char *)(up + 1), length, 1); + /* over_tcp: FALSE, is_mdns: TRUE */ + domain_print(ndo, cp, length, FALSE, TRUE); +#ifndef TCPDUMP_MINI else if (IS_SRC_OR_DST_PORT(TIMED_PORT)) - timed_print(ndo, (const u_char *)(up + 1)); + timed_print(ndo, (const u_char *)cp); +#endif else if (IS_SRC_OR_DST_PORT(TFTP_PORT)) - tftp_print(ndo, (const u_char *)(up + 1), length); + tftp_print(ndo, cp, length); else if (IS_SRC_OR_DST_PORT(BOOTPC_PORT) || IS_SRC_OR_DST_PORT(BOOTPS_PORT)) - bootp_print(ndo, (const u_char *)(up + 1), length); + bootp_print(ndo, cp, length); +#ifndef TCPDUMP_MINI else if (IS_SRC_OR_DST_PORT(RIP_PORT)) - rip_print(ndo, (const u_char *)(up + 1), length); + rip_print(ndo, cp, length); +#endif else if (IS_SRC_OR_DST_PORT(AODV_PORT)) - aodv_print(ndo, (const u_char *)(up + 1), length, + aodv_print(ndo, cp, length, ip6 != NULL); +#ifndef TCPDUMP_MINI - else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT)) - isakmp_print(ndo, (const u_char *)(up + 1), length, bp2); -+ - else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT_NATT)) - isakmp_rfc3948_print(ndo, (const u_char *)(up + 1), length, bp2); - #if 1 /*???*/ - else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT_USER1) || IS_SRC_OR_DST_PORT(ISAKMP_PORT_USER2)) - isakmp_print(ndo, (const u_char *)(up + 1), length, bp2); - #endif + else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT)) + isakmp_print(ndo, cp, length, bp2); + else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT_NATT)) + isakmp_rfc3948_print(ndo, cp, length, bp2, IP_V(ip), fragmented, ttl_hl); + else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT_USER1) || IS_SRC_OR_DST_PORT(ISAKMP_PORT_USER2)) + isakmp_print(ndo, cp, length, bp2); +#endif else if (IS_SRC_OR_DST_PORT(SNMP_PORT) || IS_SRC_OR_DST_PORT(SNMPTRAP_PORT)) - snmp_print(ndo, (const u_char *)(up + 1), length); + snmp_print(ndo, cp, length); else if (IS_SRC_OR_DST_PORT(NTP_PORT)) - ntp_print(ndo, (const u_char *)(up + 1), length); + ntp_print(ndo, cp, length); +#ifndef TCPDUMP_MINI else if (IS_SRC_OR_DST_PORT(KERBEROS_PORT) || IS_SRC_OR_DST_PORT(KERBEROS_SEC_PORT)) - krb_print(ndo, (const void *)(up + 1)); + krb_print(ndo, (const u_char *)cp); +#endif else if (IS_SRC_OR_DST_PORT(L2TP_PORT)) - l2tp_print(ndo, (const u_char *)(up + 1), length); + l2tp_print(ndo, cp, length); #ifdef ENABLE_SMB -@@ -609,6 +624,7 @@ udp_print(netdissect_options *ndo, regis +@@ -629,6 +643,7 @@ udp_print(netdissect_options *ndo, const #endif else if (dport == VAT_PORT) - vat_print(ndo, (const void *)(up + 1), up); + vat_print(ndo, cp, length); +#ifndef TCPDUMP_MINI else if (IS_SRC_OR_DST_PORT(ZEPHYR_SRV_PORT) || IS_SRC_OR_DST_PORT(ZEPHYR_CLT_PORT)) - zephyr_print(ndo, (const void *)(up + 1), length); + zephyr_print(ndo, cp, length); /* -@@ -621,8 +637,11 @@ udp_print(netdissect_options *ndo, regis +@@ -641,8 +656,11 @@ udp_print(netdissect_options *ndo, const (const u_char *) ip); else if (IS_SRC_OR_DST_PORT(RIPNG_PORT)) - ripng_print(ndo, (const u_char *)(up + 1), length); + ripng_print(ndo, cp, length); +#endif + else if (IS_SRC_OR_DST_PORT(DHCP6_SERV_PORT) || IS_SRC_OR_DST_PORT(DHCP6_CLI_PORT)) - dhcp6_print(ndo, (const u_char *)(up + 1), length); + dhcp6_print(ndo, cp, length); +#ifndef TCPDUMP_MINI else if (IS_SRC_OR_DST_PORT(AHCP_PORT)) - ahcp_print(ndo, (const u_char *)(up + 1), length); + ahcp_print(ndo, cp, length); else if (IS_SRC_OR_DST_PORT(BABEL_PORT) || IS_SRC_OR_DST_PORT(BABEL_PORT_OLD)) -@@ -636,6 +655,7 @@ udp_print(netdissect_options *ndo, regis - wb_print(ndo, (const void *)(up + 1), length); +@@ -656,6 +674,7 @@ udp_print(netdissect_options *ndo, const + wb_print(ndo, cp, length); else if (IS_SRC_OR_DST_PORT(CISCO_AUTORP_PORT)) - cisco_autorp_print(ndo, (const void *)(up + 1), length); + cisco_autorp_print(ndo, cp, length); +#endif else if (IS_SRC_OR_DST_PORT(RADIUS_PORT) || IS_SRC_OR_DST_PORT(RADIUS_NEW_PORT) || IS_SRC_OR_DST_PORT(RADIUS_ACCOUNTING_PORT) || -@@ -643,15 +663,18 @@ udp_print(netdissect_options *ndo, regis +@@ -663,15 +682,18 @@ udp_print(netdissect_options *ndo, const IS_SRC_OR_DST_PORT(RADIUS_CISCO_COA_PORT) || IS_SRC_OR_DST_PORT(RADIUS_COA_PORT) ) - radius_print(ndo, (const u_char *)(up+1), length); + radius_print(ndo, cp, length); +#ifndef TCPDUMP_MINI else if (dport == HSRP_PORT) - hsrp_print(ndo, (const u_char *)(up + 1), length); + hsrp_print(ndo, cp, length); else if (IS_SRC_OR_DST_PORT(LWRES_PORT)) - lwres_print(ndo, (const u_char *)(up + 1), length); + lwres_print(ndo, cp, length); else if (IS_SRC_OR_DST_PORT(LDP_PORT)) - ldp_print(ndo, (const u_char *)(up + 1), length); + ldp_print(ndo, cp, length); +#endif else if (IS_SRC_OR_DST_PORT(OLSR_PORT)) - olsr_print(ndo, (const u_char *)(up + 1), length, + olsr_print(ndo, cp, length, (IP_V(ip) == 6) ? 1 : 0); +#ifndef TCPDUMP_MINI else if (IS_SRC_OR_DST_PORT(MPLS_LSP_PING_PORT)) - lspping_print(ndo, (const u_char *)(up + 1), length); - else if (dport == BFD_CONTROL_PORT || -@@ -669,10 +692,12 @@ udp_print(netdissect_options *ndo, regis - lwapp_control_print(ndo, (const u_char *)(up + 1), length, 0); - else if (IS_SRC_OR_DST_PORT(LWAPP_DATA_PORT)) - lwapp_data_print(ndo, (const u_char *)(up + 1), length); + lspping_print(ndo, cp, length); + else if (sport == BCM_LI_PORT) +@@ -693,10 +715,12 @@ udp_print(netdissect_options *ndo, const + lwapp_control_print(ndo, cp, length, 0); + else if (IS_SRC_OR_DST_PORT(LWAPP_DATA_PORT)) + lwapp_data_print(ndo, cp, length); +#endif - else if (IS_SRC_OR_DST_PORT(SIP_PORT)) - sip_print(ndo, (const u_char *)(up + 1), length); - else if (IS_SRC_OR_DST_PORT(SYSLOG_PORT)) - syslog_print(ndo, (const u_char *)(up + 1), length); + else if (IS_SRC_OR_DST_PORT(SIP_PORT)) + sip_print(ndo, cp, length); + else if (IS_SRC_OR_DST_PORT(SYSLOG_PORT)) + syslog_print(ndo, cp, length); +#ifndef TCPDUMP_MINI - else if (IS_SRC_OR_DST_PORT(OTV_PORT)) - otv_print(ndo, (const u_char *)(up + 1), length); - else if (IS_SRC_OR_DST_PORT(VXLAN_PORT)) -@@ -689,7 +714,9 @@ udp_print(netdissect_options *ndo, regis - if (ndo->ndo_vflag) - ND_PRINT((ndo, "kip ")); - llap_print(ndo, cp, length); -- } else { -+ } + else if (IS_SRC_OR_DST_PORT(OTV_PORT)) + otv_print(ndo, cp, length); + else if (IS_SRC_OR_DST_PORT(VXLAN_PORT)) +@@ -722,6 +746,7 @@ udp_print(netdissect_options *ndo, const + ptp_print(ndo, cp, length); + } else if (IS_SRC_OR_DST_PORT(SOMEIP_PORT)) + someip_print(ndo, cp, length); +#endif -+ else { - if (ulen > length) - ND_PRINT((ndo, "UDP, bad length %u > %u", - ulen, length)); + else { + if (ulen > length && !fragmented) + ND_PRINT("UDP, bad length %u > %u", +--- a/print.c ++++ b/print.c +@@ -48,6 +48,7 @@ struct printer { + }; + + static const struct printer printers[] = { ++#ifndef TCPDUMP_MINI + #ifdef DLT_APPLE_IP_OVER_IEEE1394 + { ap1394_if_print, DLT_APPLE_IP_OVER_IEEE1394 }, + #endif +@@ -86,7 +87,9 @@ static const struct printer printers[] = + #ifdef DLT_ENC + { enc_if_print, DLT_ENC }, + #endif ++#endif + { ether_if_print, DLT_EN10MB }, ++#ifndef TCPDUMP_MINI + { fddi_if_print, DLT_FDDI }, + #ifdef DLT_FR + { fr_if_print, DLT_FR }, +@@ -94,6 +97,7 @@ static const struct printer printers[] = + #ifdef DLT_FRELAY + { fr_if_print, DLT_FRELAY }, + #endif ++#endif + #ifdef DLT_IEEE802_11 + { ieee802_11_if_print, DLT_IEEE802_11}, + #endif +@@ -103,6 +107,7 @@ static const struct printer printers[] = + #ifdef DLT_IEEE802_11_RADIO + { ieee802_11_radio_if_print, DLT_IEEE802_11_RADIO }, + #endif ++#ifndef TCPDUMP_MINI + #ifdef DLT_IEEE802_15_4 + { ieee802_15_4_if_print, DLT_IEEE802_15_4 }, + #endif +@@ -115,9 +120,11 @@ static const struct printer printers[] = + #ifdef DLT_IP_OVER_FC + { ipfc_if_print, DLT_IP_OVER_FC }, + #endif ++#endif + #ifdef DLT_IPNET + { ipnet_if_print, DLT_IPNET }, + #endif ++#ifndef TCPDUMP_MINI + #ifdef DLT_IPOIB + { ipoib_if_print, DLT_IPOIB }, + #endif +@@ -172,19 +179,23 @@ static const struct printer printers[] = + #ifdef DLT_MFR + { mfr_if_print, DLT_MFR }, + #endif ++#endif + #ifdef DLT_NETANALYZER + { netanalyzer_if_print, DLT_NETANALYZER }, + #endif + #ifdef DLT_NETANALYZER_TRANSPARENT + { netanalyzer_transparent_if_print, DLT_NETANALYZER_TRANSPARENT }, + #endif ++#ifndef TCPDUMP_MINI + #ifdef DLT_NFLOG + { nflog_if_print, DLT_NFLOG}, + #endif ++#endif + { null_if_print, DLT_NULL }, + #ifdef DLT_LOOP + { null_if_print, DLT_LOOP }, + #endif ++#ifndef TCPDUMP_MINI + #if defined(DLT_PFLOG) && defined(HAVE_NET_IF_PFLOG_H) + { pflog_if_print, DLT_PFLOG }, + #endif +@@ -200,6 +211,7 @@ static const struct printer printers[] = + #ifdef DLT_PPP_SERIAL + { ppp_hdlc_if_print, DLT_PPP_SERIAL }, + #endif ++#endif + { ppp_if_print, DLT_PPP }, + #ifdef DLT_PPP_PPPD + { ppp_if_print, DLT_PPP_PPPD }, +@@ -211,6 +223,7 @@ static const struct printer printers[] = + { prism_if_print, DLT_PRISM_HEADER }, + #endif + { raw_if_print, DLT_RAW }, ++#ifndef TCPDUMP_MINI + #ifdef DLT_IPV4 + { raw_if_print, DLT_IPV4 }, + #endif +@@ -243,6 +256,7 @@ static const struct printer printers[] = + #ifdef DLT_VSOCK + { vsock_if_print, DLT_VSOCK }, + #endif ++#endif + { NULL, 0 }, + }; + diff --git a/package/network/utils/tcpdump/patches/101-CVE-2020-8037.patch b/package/network/utils/tcpdump/patches/101-CVE-2020-8037.patch deleted file mode 100644 index 281854777d..0000000000 --- a/package/network/utils/tcpdump/patches/101-CVE-2020-8037.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- a/print-ppp.c -+++ b/print-ppp.c -@@ -1368,19 +1368,29 @@ trunc: - } - - #ifndef TCPDUMP_MINI -+/* -+ * Un-escape RFC 1662 PPP in HDLC-like framing, with octet escapes. -+ * The length argument is the on-the-wire length, not the captured -+ * length; we can only un-escape the captured part. -+ */ - static void - ppp_hdlc(netdissect_options *ndo, - const u_char *p, int length) - { -+ u_int caplen = ndo->ndo_snapend - p; - u_char *b, *t, c; - const u_char *s; -- int i, proto; -+ u_int i; -+ int proto; - const void *se; - -+ if (caplen == 0) -+ return; -+ - if (length <= 0) - return; - -- b = (u_char *)malloc(length); -+ b = (u_char *)malloc(caplen); - if (b == NULL) - return; - -@@ -1389,10 +1399,10 @@ ppp_hdlc(netdissect_options *ndo, - * Do this so that we dont overwrite the original packet - * contents. - */ -- for (s = p, t = b, i = length; i > 0 && ND_TTEST(*s); i--) { -+ for (s = p, t = b, i = caplen; i != 0; i--) { - c = *s++; - if (c == 0x7d) { -- if (i <= 1 || !ND_TTEST(*s)) -+ if (i <= 1) - break; - i--; - c = *s++ ^ 0x20; diff --git a/package/network/utils/tcpdump/patches/102-CVE-2018-16301.patch b/package/network/utils/tcpdump/patches/102-CVE-2018-16301.patch deleted file mode 100644 index 39cd368915..0000000000 --- a/package/network/utils/tcpdump/patches/102-CVE-2018-16301.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 8ab211a7ec728bb0ad8c766c8eeb12deb0a13b86 Mon Sep 17 00:00:00 2001 -From: Guy Harris -Date: Wed, 30 Sep 2020 11:37:30 -0700 -Subject: [PATCH] Handle very large -f files by rejecting them. - -_read(), on Windows, has a 32-bit size argument and a 32-bit return -value, so reject -f files that have more than 2^31-1 characters. - -Add some #defines so that, on Windows, we use _fstati64 to get the size -of that file, to handle large files. - -Don't assume that our definition for ssize_t is the same size as size_t; -by the time we want to print the return value of the read, we know it'll -fit into an int, so just cast it to int and print it with %d. - -(cherry picked from commit faf8fb70af3a013e5d662b8283dec742fd6b1a77) ---- - netdissect-stdinc.h | 16 +++++++++++++++- - tcpdump.c | 15 ++++++++++++--- - 2 files changed, 27 insertions(+), 4 deletions(-) - ---- a/netdissect-stdinc.h -+++ b/netdissect-stdinc.h -@@ -149,10 +149,17 @@ - #ifdef _MSC_VER - #define stat _stat - #define open _open --#define fstat _fstat - #define read _read - #define close _close - #define O_RDONLY _O_RDONLY -+ -+/* -+ * We define our_fstat64 as _fstati64, and define our_statb as -+ * struct _stati64, so we get 64-bit file sizes. -+ */ -+#define our_fstat _fstati64 -+#define our_statb struct _stati64 -+ - #endif /* _MSC_VER */ - - /* -@@ -211,6 +218,13 @@ typedef char* caddr_t; - - #include - -+/* -+ * We should have large file support enabled, if it's available, -+ * so just use fstat as our_fstat and struct stat as our_statb. -+ */ -+#define our_fstat fstat -+#define our_statb struct stat -+ - #endif /* _WIN32 */ - - #ifndef HAVE___ATTRIBUTE__ ---- a/tcpdump.c -+++ b/tcpdump.c -@@ -108,6 +108,7 @@ The Regents of the University of Califor - #endif /* HAVE_CAP_NG_H */ - #endif /* HAVE_LIBCAP_NG */ - -+#include "netdissect-stdinc.h" - #include "netdissect.h" - #include "interface.h" - #include "addrtoname.h" -@@ -861,15 +862,22 @@ read_infile(char *fname) - { - register int i, fd, cc; - register char *cp; -- struct stat buf; -+ our_statb buf; - - fd = open(fname, O_RDONLY|O_BINARY); - if (fd < 0) - error("can't open %s: %s", fname, pcap_strerror(errno)); - -- if (fstat(fd, &buf) < 0) -+ if (our_fstat(fd, &buf) < 0) - error("can't stat %s: %s", fname, pcap_strerror(errno)); - -+ /* -+ * Reject files whose size doesn't fit into an int; a filter -+ * *that* large will probably be too big. -+ */ -+ if (buf.st_size > INT_MAX) -+ error("%s is too large", fname); -+ - cp = malloc((u_int)buf.st_size + 1); - if (cp == NULL) - error("malloc(%d) for %s: %s", (u_int)buf.st_size + 1, -@@ -878,7 +886,8 @@ read_infile(char *fname) - if (cc < 0) - error("read %s: %s", fname, pcap_strerror(errno)); - if (cc != buf.st_size) -- error("short read %s (%d != %d)", fname, cc, (int)buf.st_size); -+ error("short read %s (%d != %d)", fname, (int) cc, -+ (int)buf.st_size); - - close(fd); - /* replace "# comment" with spaces */ From b32f1650480b08b39a75e9b0da2a3517955ebb56 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Mon, 27 Jun 2022 23:57:00 +0200 Subject: [PATCH 30/36] nettle: update to 3.8 Refresh: - 100-portability.patch Changelog: ea4ea5e6 Document MacOS test workaround. b14fc902 Add missing file fat-arm64.c to tar file. 6720f433 Update config.guess and config.sub to latest versions. a2be57f0 NEWS entries for Nettle-3.8. bff9a605 Update version numbers, for nettle-3.8. 36386678 Fix comment typo e05fd5a9 Add ChangeLog entry for SM3 contribution. 8739faa8 Document cbc_aes128_encrypt, cbc_aes192_encrypt and cbc_aes256_encrypt. efb2ec7f Deleted the manual's incomplete and out of date list of authors. af38c91f New more accurate AUTHORS file. ba084efa Fix ChangeLog typo. 0fff3097 ChangeLog entries for s390x ghash update. 75b687a8 Fix comment typo. 5d0089ed Refactor s390x-specific code for new ghash organization 2aabd5e2 ppc: Update fat setup for new ghash organization. 8f5fddfb ppc: Update vpmsumd ghash to new organization. 1227381e Comment fix. 9939f866 arm64: Update fat setup for new ghash organization. ab62f731 Fix comment error b1645555 arm64: Update pclmul ghash to new organization. 6b80b889 Update fat setup for new ghash organization. d382fcc0 Delete _ghash_digest. d11c4cd9 x86_64: Update pclmul ghash to new organization. f79cc0c1 x86_64: Update table-based ghash to new organization. bdc2fc31 Move _ghash_digest. 1d438ad4 Refactor GCM C implementation. bdf820df New function block16_zero. d966ea0d Delete code for GCM_TABLE_BITS != 8. 60edc290 x86_64: Fat setup for GCM. be245313 Fix comment typo. f8fa4f1f x86_64: Initial implementation of gcm using the pclmulqdq instructions. 23f75f58 Rearrange gcm configuration defines, and add tests for internal functions. 483ccbc9 Add tests for edge cases in poly1305 digest folding. f3656a44 x86_64: Rewrite of poly1305 assembly. b7268727 ChangeLog entry for arm64 implementation of chacha. 1d4a985c ChangeLog entries for new ppc64 ecc files. 99be366f ecc: Add powerpc64 assembly for ecc_448_modp 53f7ae66 Move a comment. e643dcf1 ecc: Add powerpc64 assembly for ecc_25519_modp 741191d1 ecc: Add powerpc64 assembly for ecc_224_modp 4adcb4af Simplify poly1305-test, more use of tstring length. b48217c8 Add randomized tests of poly1305. dbf178c0 Arrange so that GMP or mini-gmp is always available for tests. 7d83510e ChangeLog entries for new ppc64 ecc files. 02bbf7d1 ecc: Add powerpc64 assembly for ecc_521_modp 2bc7dfad ecc: Add powerpc64 assembly for ecc_384_modp 9b6c0639 ecc: Add powerpc64 assembly for ecc_192_modp 39af7b2e [Arm64] Optimize Chacha20 c82876a5 [S390x] Alerting assembler of machine type 044d24b0 [S390x] Optimize Chacha20 94228f87 tests: Use inline function for dummy definition of test_randomize. 7926debe Share ecc point validation function in testutils.c. 25f73004 Whitespace cleanup 0ec184d8 ppc: Reduce number of registers used for ecc_secp256r1_redc. c7cf1939 ppc: New configure test for ELFV2_ABI f57640ea x86_64: Improved ecc_secp256r1_redc dd65a63e ChangeLog for previous change. ecd4eacf ppc: Add powerpc64 assembly for ecc_256_redc b2758f7c doc: documentation for SM3 hash 0ea74c02 Comment improvements for x86_64 ecc_secp256r1_redc 78aabc69 nettle-benchmark: bench SM3 hashes 7f77ccb4 hmac: add support for SM3 hash function e2edd9be testsuite: add test for SM3 hash function b72886e5 Add OSCCA SM3 hash algorithm d2e4e531 Delete function mpz_limbs_read_n. dd566239 Delete function mpz_limbs_cmp. 07d5e755 gitlab-ci: Enable randomized tests 64ce8c77 Randomize more tests a6f9bdeb Reduce allocation in modinv test 957482d9 Fix sqrt_ratio test for v = 0 case. 7f730943 Reduce allocation in sqrt tests 2c9a600d Move NETTLE_TEST_SEED logic to testutils.c. 48d61c28 Delete obsolete comment. ac95be13 Fix and test for sqrt(0) special case. ffe0f587 eccdata: Output ecc_sqrt_z and ECC_SQRT_E only when computed. 65c95c79 Fix comment typo. 8db66280 Let secp384r1 inverse and sqrt share most of the powering. 5b2758a3 eccdata: Delete generation of unused values ecc_sqrt_t and ECC_SQRT_T_BITS. b3abfac5 eccdata: Generate both redc and non-redc versions of ecc_sqrt_z. 2dbe065d Implement secp224r1 square root, based on patch by Wim Lewis. c8daa71c New function ecc_mod_equal_p, based on patch by Wim Lewis. 4be1725f New function ecc_mod_pow_127m1, used for ecc_secp224r1_inv. 4e987de3 Implement secp521r1 square root, based on patch by Wim Lewis. 2adc4268 Implement secp384r1 square root, based on patch by Wim Lewis. bc07754f Implement secp256r1 square root, based on patch by Wim Lewis. 35f12552 Implement secp192r1 square root, based on patch by Wim Lewis. c2726388 Renamed sqrt_itch --> sqrt_ratio_itch, and curve25519 and curve448 sqrt functions. 03421be1 Rename ecc sqrt --> sqrt_ratio. 652bdc79 New function ecc_mod_zero_p. 571d2cc2 [S390x] Improvements on documentation and instruction set usage for SHA3 permute 26b0f47b New function sec_zero_p. 259ec19a [S390x] Remove lgr instructions by using xgrk instead of xgr instruction 73722fb0 Rewrite of secp256r1 mod functions. 45028ff2 Extend ecc-mod-test, with improved coverage of corner cases. 806d6f6a [S390x] Optimize SHA3 permute using vector facility 78f44318 Change "signature on digest" --> "of digest". 0f90c076 Doc fixes. 52c86f94 Delete a few old FIXME comments 2b68ee47 Use @url and https consistently for references. Fix overlong lines. ea4b2e86 Use texi2pdf to generate the pdf manual 54bbc09b ChangeLog entries for doc structure improvements. cc92638c Divide Cipher section into menu and nodes, and some other minor fixes. 5e6af10b Delete explicit node pointers in nettle.texinfo 55584f4e Change CBC-AES interface 7a966ac3 Test AEAD encrypt/decrypt with message split into pieces. 686fd559 More checks for null pointers in test_aead, to silent static analyzer. 41a72c24 Fix checks of HAVE_NATIVE_cbc_aes*_encrypt d5b0b9cb Fix fat builds for x86_64 windows 419d7af5 x86_64: Fat setup for assembly CBC AES. 121290e0 x86_64: Assembly CBC AES aesni functions. 1f58b09c Add specialized functions for cbc-aes. 99dffa9c ChangeLog entries for recent contributions. 38092fde gitlab-ci: Use mini-gmp for big-endian powerpc64 cross build 4147279b gitlab-ci: Explicitly install cross libgmp-dev packages 8c2321d2 gitlab-ci: No-assembly cross-build for s390x, to test big-endian d4cd2965 gitlab-ci: Delete mips build 9765f8b9 [S390x] Optimize SHA256 and SHA512 compress functions 463553ae x86_64: New 2-way aesni loop also for aes256 c7391e5c x86_64: Refactor aesni assembly, with specific functions for each key size. 4ea2a1f8 [S390x] Optimize SHA1 compress a47813c2 [AArch64] Utilize AES 1-block macros in 4-block macros 5f7740a3 [AArch64] Load AES keys at function prologue 76c7418c ChangeLog entries for previous change. f7bc3e1b [AArch64] Move AES round macros to machine.m4 39d1e2a3 [AArch64] Optimize AES with fat build support b8054a1d [S390x] Optimize memxor3 using vector facility with fat support 422219fe [S390x] Optimize memxor 3900fe65 Add fat-s390x.c to OPT_SOURCES. c2f16582 Fix name of s390x/fat directory in make dist target. 4fc00c4d [S390x] add FAT_TEST_LIST variable to enable fat build testing 856c62ef [S390x] Replace inline assembly and fix fat filenames 3be3ff3e [S390x] Fat build support for AES and GHASH 9f9d4c4b arm64: Add sha2 to aarch64 fat tests. 774917ec ChangeLog entry for arm64 sha256.. 7b446327 [AArch64] Fat build support for SHA-256 compress 6c84092d [S390x] wipe parameter block content and leftover bytes of data from stack 7d301d93 [S390x] wipe hash subkey from stack once GHASH operation completed d1c8417f [AArch64] Optimize SHA-256 compress 33bfc509 [S390x] Use uppercase for macro names in machine.m4 and enhance the documentation for GHASH implementation 94be863c Add sha1 to aarch64 fat tests. 6c89ed3c ChangeLog entry for previous change. e5a9dbf4 arm64: Fat build support for SHA1 compress 530e4c8d [S390x] Update configure.ac and Makefile.in b0525367 [S390x] Implement alloc_stack and free_stack macros in machine.m4 72448928 [S390x] Optimize GHASH 20fedc01 Update Nettle-3.7.3 NEWS. c80961c6 Add input check to rsa_decrypt family of functions. cd6059ae Change _rsa_sec_compute_root_tr to take a fix input size. 401e0bdd Fix comment typos. fd6d9ba7 Add check that message length to _pkcs1_sec_decrypt is valid. e60d8367 ChangeLog entry for arm64 sha1. 47cafcf2 aarch64: Optimize SHA1 Compress a46a17e9 Fix C++-style comments 022e51a2 ChangeLog entries for aes keywrap. 0145efbc Implement aes key wrap and key unwrap (RFC 3394) 61bcbbf8 gitlab-ci: Explicitly pass --enable-s390x-msa to s390x build. 3b1bb7cb Fix comment typo. c23701f3 Reorder and indent asm_replace_list. c2a14fa3 ChangeLog entry for new s390x AES implementation. 1f38723e Append s390x-specific asm file names to asm_replace_list in configure.ac 71dafe91 [S390x] Basic AES-192 and AES-256 optimizations 8247fa21 ppc: Fix macro name SWAP_MASK to use all uppercase. b9f0ede2 Update config.guess and config.sub. 46515038 [S390x] Basic AES-128 optimization f4dc5f20 Split aes-encrypt.c and aes-decrypt.c into one file per key size. 0bff7a2b Initial config for s390x, contributed by Mamone Tarsha. 06d6ef33 nettle-benchmark: avoid -Wmaybe-uninitialized warnings dda3f4fd gitlab-ci: Fix only: variables: check, and quote variables. c2b56cd7 gitlab-ci: Use pipeline variable S390X_ACCOUNT c25774e2 gitlab-ci: Add remote tests for s390x. d5972ced Add forward declaration of struct aes_table. 085317d6 ChangeLog entries for arm64 fat build. 944881d7 ChangeLog entry for nettle-3.7.2 release f9e0e1f4 NEWS entries for 3.7.2. 1585f6ac [AArch64] Support fat build for GCM optimization 03b8ba39 [AArch64] Use m4 macros in gcm-hash.asm and add documentation comments 3f43c143 [AArch64] Update README to be on par with other architectures b30e0ca6 Fix canonical reduction in gostdsa_vko. d9b564e4 Similar fix for eddsa. fbaefb64 Analogous fix to ecc_gostdsa_verify. c24b3616 Ensure ecdsa_sign output is canonically reduced. 2397757b Fix bug in ecc_ecdsa_verify. 5b7608fd Use ecc_mod_mul_canonical for point comparison. 2bf497ba New functions ecc_mod_mul_canonical and ecc_mod_sqr_canonical. a471ae85 aarch64: Rename arm64/v8/ --> arm64/crypto/ 0489825e aarch64: Use .arch armv8-a+crypto directive. d32152f4 aarch64: Move m4 definitions after .file directive f3dda9f4 ChangeLog entries for arm64 gcm_hash. b098f19b arch64: Fix clang build fd9dd9d7 arch64: Fix copyright line and typos a3f91c0e aarch64: Adjust gcm-hash assembly for big-endian systems 09d77a10 aarch64: Implement GHASH using the crypto extension pmul instructions. 0c5429d3 aarch64: Add README dbd16501 Add an empty machine.m64 to make configure happy ebf9ae83 Recognize arm64 in configure Signed-off-by: Nick Hainke --- package/libs/nettle/Makefile | 4 ++-- package/libs/nettle/patches/100-portability.patch | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package/libs/nettle/Makefile b/package/libs/nettle/Makefile index 87853baa82..0c06205ec2 100644 --- a/package/libs/nettle/Makefile +++ b/package/libs/nettle/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nettle -PKG_VERSION:=3.7.3 +PKG_VERSION:=3.8 PKG_RELEASE:=$(AUTORELEASE) PKG_USE_MIPS16:=0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@GNU/nettle -PKG_HASH:=661f5eb03f048a3b924c3a8ad2515d4068e40f67e774e8a26827658007e3bcf0 +PKG_HASH:=7576c68481c198f644b08c160d1a4850ba9449e308069455b5213319f234e8e6 PKG_LICENSE:=GPL-2.0-or-later PKG_LICENSE_FILES:=COPYING diff --git a/package/libs/nettle/patches/100-portability.patch b/package/libs/nettle/patches/100-portability.patch index 5bbae22752..b4677ec020 100644 --- a/package/libs/nettle/patches/100-portability.patch +++ b/package/libs/nettle/patches/100-portability.patch @@ -1,6 +1,6 @@ --- a/configure +++ b/configure -@@ -4661,6 +4661,7 @@ $as_echo_n "checking build system compil +@@ -4704,6 +4704,7 @@ $as_echo_n "checking build system compil # remove anything that might look like compiler output to our "||" expression rm -f conftest* a.out b.out a.exe a_out.exe cat >conftest.c <conftest.c <conftest.c <conftest.c < Date: Mon, 27 Jun 2022 15:11:47 +0200 Subject: [PATCH 31/36] libjson-c: update to 0.16 Fix: - 001-dont-build-docs.patch Remove upstreamed patch: - 010-clang.patch Changelog: Deprecated and removed features: -------------------------------- * JSON_C_OBJECT_KEY_IS_CONSTANT is deprecated in favor of JSON_C_OBJECT_ADD_CONSTANT_KEY * Direct access to lh_table and lh_entry structure members is deprecated. Use access functions instead, lh_table_head(), lh_entry_next(), etc... * Drop REFCOUNT_DEBUG code. New features ------------ * The 0.16 release introduces no new features Build changes ------------- * Add a DISABLE_EXTRA_LIBS option to skip using libbsd * Add a DISABLE_JSON_POINTER option to skip compiling in json_pointer support. Significant changes and bug fixes --------------------------------- * Cap string length at INT_MAX to avoid various issues with very long strings. * json_object_deep_copy: fix deep copy of strings containing '\0' * Fix read past end of buffer in the "json_parse" command * Avoid out of memory accesses in the locally provided vasprintf() function (for those platforms that use it) * Handle allocation failure in json_tokener_new_ex * Fix use-after-free in json_tokener_new_ex() in the event of printbuf_new() returning NULL * printbuf_memset(): set gaps to zero - areas within the print buffer which have not been initialized by using printbuf_memset * printbuf: return -1 on invalid arguments (len < 0 or total buffer > INT_MAX) * sprintbuf(): propagate printbuf_memappend errors back to the caller Optimizations -------------- * Speed up parsing by replacing ctype functions with simplified, faster non-locale-sensitive ones in json_tokener and json_object_to_json_string. * Neither vertical tab nor formfeed are considered whitespace per the JSON spec * json_object: speed up creation of objects, calloc() -> malloc() + set fields * Avoid needless extra strlen() call in json_c_shallow_copy_default() and json_object_equal() when the object is known to be a json_type_string. Other changes ------------- * Validate size arguments in arraylist functions. * Use getrandom() if available; with GRND_NONBLOCK to allow use of json-c very early during boot, such as part of cryptsetup. * Use arc4random() if it's available. * random_seed: on error, continue to next method instead of exiting the process * Close file when unable to read from /dev/urandom in get_dev_random_seed() Signed-off-by: Nick Hainke --- package/libs/libjson-c/Makefile | 6 +++--- .../libs/libjson-c/patches/001-dont-build-docs.patch | 8 ++++---- package/libs/libjson-c/patches/010-clang.patch | 11 ----------- 3 files changed, 7 insertions(+), 18 deletions(-) delete mode 100644 package/libs/libjson-c/patches/010-clang.patch diff --git a/package/libs/libjson-c/Makefile b/package/libs/libjson-c/Makefile index 0f13883a3b..2b90c27a4a 100644 --- a/package/libs/libjson-c/Makefile +++ b/package/libs/libjson-c/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=json-c -PKG_VERSION:=0.15 -PKG_RELEASE:=2 +PKG_VERSION:=0.16 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-nodoc.tar.gz PKG_SOURCE_URL:=https://s3.amazonaws.com/json-c_releases/releases/ -PKG_HASH:=99bca4f944b8ced8ae0bbc6310d6a3528ca715e69541793a1ef51f8c5b4b0878 +PKG_HASH:=ac8a3dd6820daaca579b23fbc74664310fbc3d67f52f6707cda67d21dde5570f PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=MIT diff --git a/package/libs/libjson-c/patches/001-dont-build-docs.patch b/package/libs/libjson-c/patches/001-dont-build-docs.patch index 1aa0da4f59..f35da80724 100644 --- a/package/libs/libjson-c/patches/001-dont-build-docs.patch +++ b/package/libs/libjson-c/patches/001-dont-build-docs.patch @@ -1,11 +1,11 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -401,8 +401,6 @@ set(JSON_C_SOURCES +@@ -433,8 +433,6 @@ configure_file(json.h.cmakein ${PROJECT_ include_directories(${PROJECT_SOURCE_DIR}) include_directories(${PROJECT_BINARY_DIR}) -add_subdirectory(doc) - - # uninstall - add_custom_target(uninstall - COMMAND cat ${PROJECT_BINARY_DIR}/install_manifest.txt | xargs rm + # "uninstall" custom target for make generators in unix like operating systems + # and if that target is not present + if (CMAKE_GENERATOR STREQUAL "Unix Makefiles") diff --git a/package/libs/libjson-c/patches/010-clang.patch b/package/libs/libjson-c/patches/010-clang.patch deleted file mode 100644 index 9ef73f1a82..0000000000 --- a/package/libs/libjson-c/patches/010-clang.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -265,7 +265,7 @@ message(STATUS "Wrote ${PROJECT_BINARY_D - configure_file(${PROJECT_SOURCE_DIR}/cmake/json_config.h.in ${PROJECT_BINARY_DIR}/json_config.h) - message(STATUS "Wrote ${PROJECT_BINARY_DIR}/json_config.h") - --if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") -+if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections") - if ("${DISABLE_WERROR}" STREQUAL "OFF") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") From 576b62712fa7552f4fa30b67b47004745fee5287 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 3 Jul 2022 18:24:58 +0200 Subject: [PATCH 32/36] mac80211: Add DRIVER_11AX_SUPPORT dependency to mac80211-hwsim and iwlwifi The mac80211-hwsim and the Intel iwlwifi driver support ieee80211ax, add the missing DRIVER_11AX_SUPPORT dependency too. Signed-off-by: Hauke Mehrtens --- package/kernel/mac80211/Makefile | 2 +- package/kernel/mac80211/intel.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index e51208aaba..3917f48f05 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -252,7 +252,7 @@ endef define KernelPackage/mac80211-hwsim $(call KernelPackage/mac80211/Default) TITLE:=mac80211 HW simulation device - DEPENDS+= +kmod-mac80211 +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT + DEPENDS+= +kmod-mac80211 +@DRIVER_11AX_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mac80211_hwsim.ko AUTOLOAD:=$(call AutoProbe,mac80211_hwsim) endef diff --git a/package/kernel/mac80211/intel.mk b/package/kernel/mac80211/intel.mk index 8bab727a41..a915f94bf9 100644 --- a/package/kernel/mac80211/intel.mk +++ b/package/kernel/mac80211/intel.mk @@ -15,7 +15,7 @@ config-$(call config_package,ipw2200) += IPW2200 define KernelPackage/iwlwifi $(call KernelPackage/mac80211/Default) - DEPENDS:= +kmod-mac80211 @PCI_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT + DEPENDS:= +kmod-mac80211 @PCI_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11AX_SUPPORT TITLE:=Intel AGN Wireless support FILES:= \ $(PKG_BUILD_DIR)/drivers/net/wireless/intel/iwlwifi/iwlwifi.ko \ From 4b0c433c39fc1aa28ba0af01987017330d555379 Mon Sep 17 00:00:00 2001 From: Sergei Iudin Date: Wed, 17 Jun 2020 15:44:30 -0700 Subject: [PATCH 33/36] ramips: Add suport for COMFAST CF-WR617AC Specifications: Chipset:MT7628DA+MT7612E Antenna : 2.4Ghz:2x5dbi Antenna + 5.8Ghz:2x5dbi Antenna Wireless Rate:2.4Ghz 300Mbps , 5.8Ghz 867Mbps Output Power :100mW(20dbm) Physical port:110/100Mbps RJ45 WAN Port , 310/100Mbps RJ45 LAN Port Flash: 8Mb DRam: 64Mb Flashing: default bootloader attempts to boot from tftp://192.168.1.10/firmware_auto.bin using 192.168.1.1 Known issues: mac-address-increment for 5GHZ doesnt work, i failed to figure out why. Original firmware using +1 from original value in factory partition. Signed-off-by: Sergei Iudin --- .../dts/mt7628an_comfast_cf-wr617ac.dts | 123 ++++++++++++++++++ target/linux/ramips/image/mt76x8.mk | 9 ++ .../mt76x8/base-files/etc/board.d/02_network | 8 ++ 3 files changed, 140 insertions(+) create mode 100644 target/linux/ramips/dts/mt7628an_comfast_cf-wr617ac.dts diff --git a/target/linux/ramips/dts/mt7628an_comfast_cf-wr617ac.dts b/target/linux/ramips/dts/mt7628an_comfast_cf-wr617ac.dts new file mode 100644 index 0000000000..81734ed4fb --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_comfast_cf-wr617ac.dts @@ -0,0 +1,123 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7628an.dtsi" +#include +#include + +/ { + compatible = "comfast,cf-wr617ac", "mediatek,mt7628an-soc"; + model = "Comfast CF-WR617AC"; + + keys { + compatible = "gpio-keys"; + reset { + label = "reset"; + gpios = <&gpio 38 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + led_status_blue: status_blue { + label = "blue:status"; + gpios = <&gpio 44 GPIO_ACTIVE_LOW>; + }; + led_status_red: status_red { + label = "red:status"; + gpios = <&gpio 37 GPIO_ACTIVE_LOW>; + }; + }; + + aliases { + led-boot = &led_status_red; + led-failsafe = &led_status_red; + led-running = &led_status_blue; + led-upgrade = &led_status_red; + }; + + + chosen { + bootargs = "console=ttyS0,115200"; + }; + +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x760000>; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + mtd-mac-address = < 0x8004>; + mac-address-increment = <2>; + }; +}; + +ðernet { + nvmem-cells = <&macaddr_factory_e000>; + nvmem-cell-names = "mac-address"; +}; + +&esw { + mediatek,portmap = <0x2f>; +}; + +&wmac { + status = "okay"; + mediatek,mtd-eeprom = <&factory 0x0>; +}; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + macaddr_factory_e000: macaddr@4 { + reg = <0xe000 0x6>; + }; +}; diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 5bb9bf61b7..5c10159568 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -107,6 +107,15 @@ define Device/buffalo_wcr-1166ds endef TARGET_DEVICES += buffalo_wcr-1166ds +define Device/comfast_cf-wr617ac + IMAGE_SIZE := 7872k + DTS := CF-WR617AC + DEVICE_VENDOR := Comfast + DEVICE_MODEL := CF-WR617AC + DEVICE_PACKAGES := kmod-mt76x2 kmod-rt2800-pci +endef +TARGET_DEVICES += comfast_cf-wr617ac + define Device/comfast_cf-wr758ac IMAGE_SIZE := 7872k DEVICE_VENDOR := COMFAST diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index 408f5f5e01..0d2c40446a 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -77,6 +77,10 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "3:lan" "4:wan" "6@eth0" ;; + comfast,cf-wr617ac) + ucidef_add_switch "switch0" \ + "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0" + ;; comfast,cf-wr758ac-v1|\ comfast,cf-wr758ac-v2|\ tplink,tl-wr902ac-v3|\ @@ -191,6 +195,10 @@ ramips_setup_macs() lan_mac=$wan_mac label_mac=$wan_mac ;; + comfast,cf-wr617ac) + lan_mac=$(mtd_get_mac_binary factory 0xe000) + wan_mac=$(macaddr_add "$lan_mac" 1) + ;; cudy,wr1000|\ hilink,hlk-7628n|\ hilink,hlk-7688a|\ From 1a8c74da709190e5157af9f5c2502b600f6273bb Mon Sep 17 00:00:00 2001 From: Nita Vesa Date: Fri, 29 Apr 2022 13:57:24 +0300 Subject: [PATCH 34/36] ramips: Add Xiaomi Mi Router 4A 100M International The international version of Mi Router 4A 100M is physically identical to the non-international one, but appears to be using a different partitioning scheme with the "overlay" partition being 2MiB in size instead of 1MiB. This means the following "firmware" partition starts at a different address and the DTS needs to be adjusted for the firmware to work. Signed-off-by: Nita Vesa --- ...mt7628an_xiaomi_mi-router-4a-100m-intl.dts | 56 +++++++++++++++++++ target/linux/ramips/image/mt76x8.mk | 10 ++++ .../mt76x8/base-files/etc/board.d/02_network | 4 +- 3 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m-intl.dts diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m-intl.dts b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m-intl.dts new file mode 100644 index 0000000000..cdf259c51a --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m-intl.dts @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7628an_xiaomi_mi-router-4.dtsi" + +/ { + compatible = "xiaomi,mi-router-4a-100m-intl", "mediatek,mt7628an-soc"; + model = "Xiaomi Mi Router 4A (100M International Edition)"; +}; + +&partitions { + partition@60000 { + label = "overlay"; + reg = <0x60000 0x200000>; + read-only; + }; + + partition@260000 { + label = "firmware"; + reg = <0x260000 0xda0000>; + compatible = "denx,uimage"; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +ðernet { + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; +}; + +&esw { + mediatek,portmap = <0x3e>; + mediatek,portdisable = <0x2a>; +}; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; +}; diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 5c10159568..21126c32d9 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -917,6 +917,16 @@ define Device/xiaomi_mi-router-4a-100m endef TARGET_DEVICES += xiaomi_mi-router-4a-100m +define Device/xiaomi_mi-router-4a-100m-intl + IMAGE_SIZE := 14976k + DEVICE_VENDOR := Xiaomi + DEVICE_MODEL := Mi Router 4A + DEVICE_VARIANT := 100M International Edition + DEVICE_PACKAGES := kmod-mt76x2 + SUPPORTED_DEVICES += xiaomi,mir4a-100m-intl +endef +TARGET_DEVICES += xiaomi_mi-router-4a-100m-intl + define Device/xiaomi_mi-router-4c IMAGE_SIZE := 14976k DEVICE_VENDOR := Xiaomi diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index 0d2c40446a..1c3d43d821 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -152,7 +152,8 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "0:wan" "3:lan" "4:lan" "6@eth0" ;; - xiaomi,mi-router-4a-100m) + xiaomi,mi-router-4a-100m|\ + xiaomi,mi-router-4a-100m-intl) ucidef_add_switch "switch0" \ "4:lan:1" "2:lan:2" "0:wan" "6@eth0" ;; @@ -280,6 +281,7 @@ ramips_setup_macs() wan_mac=$(mtd_get_mac_binary factory 0x28) ;; xiaomi,mi-router-4a-100m|\ + xiaomi,mi-router-4a-100m-intl|\ xiaomi,mi-router-4c) wan_mac=$(mtd_get_mac_binary factory 0x4) ;; From 36f3238dcb119f9e6b79e01d8f97776f67a7bfce Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Sat, 2 Jul 2022 18:51:15 +0200 Subject: [PATCH 35/36] strace: update to 5.17 Improvements - Added 64-bit LoongArch architecture support. - Extended personality designation syntax of syscall specification expressions to support all@pers and %class@pers. - Enhanced rejection of invalid syscall numbers in syscall specification expressions. - Implemented decoding of set_mempolicy_home_node syscall, introduced in Linux 5.17. - Implemented decoding of IFLA_GRO_MAX_SIZE and TCA_ACT_IN_HW_COUNT netlink attributes. - Implemented decoding of PR_SET_VMA operation of prctl syscall. - Implemented decoding of siginfo_t.si_pkey field. - Implemented decoding of LIRC ioctl commands. - Updated lists of FAN_*, IORING_*, IOSQE_*, KEY_*, KVM_*, MODULE_INIT_*, TCA_ACT_*, and *_MAGIC constants. - Updated lists of ioctl commands from Linux 5.17. Signed-off-by: Nick Hainke --- package/devel/strace/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/devel/strace/Makefile b/package/devel/strace/Makefile index 8f66ffbe47..7ca02f2914 100644 --- a/package/devel/strace/Makefile +++ b/package/devel/strace/Makefile @@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=strace -PKG_VERSION:=5.16 +PKG_VERSION:=5.17 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://strace.io/files/$(PKG_VERSION) -PKG_HASH:=dc7db230ff3e57c249830ba94acab2b862da1fcaac55417e9b85041a833ca285 +PKG_HASH:=5fb298dbd1331fd1e1bc94c5c32395860d376101b87c6cd3d1ba9f9aa15c161f PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=LGPL-2.1-or-later From 6d423ffbd17f5b00432f8f7a9fc7ea18d437d902 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Sat, 2 Jul 2022 18:53:07 +0200 Subject: [PATCH 36/36] strace: update to 5.18 Improvements - Added an interface of raising des Strausses awareness. - Added --tips option to print strace tips, tricks, and tweaks at the end of the tracing session. - Enhanced decoding of bpf and io_uring_register syscalls. - Implemented decoding of COUNTER_*, RTC_PARAM_GET, and RTC_PARAM_SET ioctl commands. - Updated lists of BPF_*, BR_*, BTRFS_*, IFA_*, IFLA_*, IORING_*, KEY_*, KVM_*, MADV_*, and UFFD_* constants. - Updated lists of ioctl commands from Linux 5.18. Bug fixes - Fixed printing of the updated value of union bpf_attr.next_id on the exiting of bpf(BPF_*_GET_NEXT_ID) calls. Signed-off-by: Nick Hainke --- package/devel/strace/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/devel/strace/Makefile b/package/devel/strace/Makefile index 7ca02f2914..d95fd41c33 100644 --- a/package/devel/strace/Makefile +++ b/package/devel/strace/Makefile @@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=strace -PKG_VERSION:=5.17 +PKG_VERSION:=5.18 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://strace.io/files/$(PKG_VERSION) -PKG_HASH:=5fb298dbd1331fd1e1bc94c5c32395860d376101b87c6cd3d1ba9f9aa15c161f +PKG_HASH:=60293ea79ac9253d600cdc9be077ad2988ca22284a439c9e66be5150db3d1187 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=LGPL-2.1-or-later