Commit Graph

54148 Commits

Author SHA1 Message Date
Hauke Mehrtens 510f0628c7 OpenWrt v22.03.0: revert to branch defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-09-03 18:49:08 +02:00
Hauke Mehrtens 17bd6b0477 OpenWrt v22.03.0: adjust config defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-09-03 18:49:01 +02:00
Daniel Golle 512e76967f uboot-mediatek: mt7622: suppress unwanted pinctrl warning
Import patch which removes the default pinctrl of uart0 to suppress
the unwanted warning. Apply also to downstream boards.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-09-03 03:55:34 +01:00
Daniel Golle d691625ec4 mediatek: mt7622: fix DTS compatible of UniFi 6 LR variants
Make sure the compatible string in DTS matches the now v1/v2
differentiated board name in target/linux/mediatek/image/mt7622.mk.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit be555b9dd8)
2022-09-03 02:28:41 +01:00
Daniel Golle 93e6581b90 uboot-mediatek: backport fix for unstable UART on MT7622
Import pending patch "arm: dts: mt7622: force high-speed mode for uart"
from Weijie Gao <weijie.gao@mediatek.com> fixing the UART problems on
MT7622 which made it hard to use the U-Boot menu on devices with this
SoC.

This patch is also contained in commit
 c09eb08dad ("uboot-mediatek: add support for MT798x platforms")
in the development branch.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-09-03 02:03:42 +01:00
Daniel Golle 3889f90ee2 uboot-mediatek: no compression means IH_COMP_NONE
Treat missing compression node in FIT image as IH_COMP_NONE.
This is implicentely already happening in most places, but for now
was still triggering an annoying warning about initramfs compression
being obsolete despite compression note being absent.
Fix this.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 0a18456ffc)
2022-09-03 02:00:16 +01:00
Daniel Golle 8ff8a4dc9e uboot-mediatek: fix factory reset on UBI
Truncating a UBI volume using `ubi write 0x0 volname 0x0` results in
segfault on newer U-Boot. Write 1MB of 0s instead.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit d118cbdfec)
2022-09-03 02:00:16 +01:00
Daniel Golle aebb19d34b uboot-envtools: mt7622: use 4k sectors for UniFi 6 LR (ubootmod)
Use 4k sectors when accessing the U-Boot environment on the 64MiB
SPI-NOR flash chip found in the UniFi 6 LR. The speeds up environment
write access as only 4kB instead of 64kB have to be written.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit f0adf253fd)
2022-09-03 02:00:16 +01:00
Daniel Golle 557e4cb169 mediatek: mt7622: use variable sector size for spi-nor
Make use of minor sector size (4k) on supported SPI-NOR flash chips.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 51f4c84178)
2022-09-03 02:00:16 +01:00
Daniel Golle f7c358c2ad uboot-mediatek: fix Ubiquiti UniFi 6 LR U-Boot mod
Image names as well as the calculation of the padded image size did
not work as intended. Fix that.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 0bc8889e7b)
2022-09-03 02:00:16 +01:00
Martin Kennedy ae1786e543 mpc85xx: Drop pci aliases to avoid domain changes
As of upstream Linux commit 0fe1e96fef0a ("powerpc/pci: Prefer PCI
domain assignment via DT 'linux,pci-domain' and alias"), the PCIe
domain address is no longer numbered by the lowest 16 bits of the PCI
register address after a fallthrough. Instead of the fallthrough, the
enumeration process accepts the alias ID (as determined by
`of_alias_scan()`). This causes e.g.:

9000:00:00.0 PCI bridge: Freescale Semiconductor Inc P1020E (rev 11)
9000:01:00.0 Network controller: Qualcomm Atheros AR958x 802.11abgn ...

to become

0000:00:00.0 PCI bridge: Freescale Semiconductor Inc P1020E (rev 11)
0000:01:00.0 Network controller: Qualcomm Atheros AR958x 802.11abgn ...

... which then causes the sysfs path of the netdev to change,
invalidating the `wifi_device.path`s enumerated in
`/etc/config/wireless`.

One other solution might be to migrate the uci configuration, as was
done for mvebu in commit 0bd5aa89fc ("mvebu: Migrate uci config to
new PCIe path"). However, there are concerns that the sysfs path will
change once again once some upstream patches[^2][^3] are merged and
backported (and `CONFIG_PPC_PCI_BUS_NUM_DOMAIN_DEPENDENT` is enabled).

Instead, remove the aliases and allow the fallthrough to continue for
now. We will provide a migration in a later release.

This was first reported as a Github issue[^1].

[^1]: https://github.com/openwrt/openwrt/issues/10530
[^2]: https://lore.kernel.org/linuxppc-dev/20220706104308.5390-1-pali@kernel.org/t/#u
[^3]: https://lore.kernel.org/linuxppc-dev/20220706101043.4867-1-pali@kernel.org/

Fixes: #10530
Tested-by: Martin Kennedy <hurricos@gmail.com>
[Tested on the Aerohive HiveAP 330 and Extreme Networks WS-AP3825i]
Signed-off-by: Martin Kennedy <hurricos@gmail.com>
(cherry picked from commit 7f4b4c29f3)
2022-09-02 21:42:52 +02:00
Claudiu Beznea ea4ec11f4e at91bootstrap: use sdmmc0 as booting media for sama5d27_som1_ek
Commit 0b7c66c ("at91bootstrap: add sama5d27_som1_eksd1_uboot as
default defconfig") changed default booting media for sama5d27_som1_ek
board w/o any reason. Changed it back to sdmmc0 as it is for all the
other Microchip supported distributions for this board (Buildroot,
Yocto Project). The initial commit cannot be cleanly reverted.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
(cherry picked from commit e9f12931e6)
2022-09-02 21:42:50 +02:00
Claudiu Beznea c53fea7a8a uboot-at91: use sdmmc0 as booting media for sama5d27_som1_ek
Commit adc69fe (""uboot-at91: changed som1 ek default defconfigs")
changed the booting media to sdmmc1 as default booting w/o any reason.
The Microchip releases for the rest of supported distributions (Buildroot,
Yocto Project) uses sdmmc0 as default booting media for this board.
Thus change it back to sdmmc0. With this remove references to sdmmc1
config. The initial commit cannot be cleanly reverted.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
(cherry picked from commit 9a49788008)
2022-09-02 21:42:49 +02:00
Rafał Miłecki 2ae0ad375b kernel: rename 5.20 patches to 6.0
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 372ee1919d)
2022-09-02 13:36:54 +02:00
Rafał Miłecki d3ccf0976a bcm4908: enable & setup packet steering
Without packet steering NAT masquarade speed on BCM4908 /jumps/ between
two speeds:
1. 826 Mb/s (±3 Mb/s)
2. 909 Mb/s (±8 Mb/s)
and it never reaches ~940 Mb/s.

Proper packet steering can improve it. Below are testing results for
running iperf TCP traffic from LAN to WAN. They were used to pick up
golden values.

┌──────────┬──────────┬───────────┐
│   eth0   │  br-lan  │   speed   │
│ rps_cpus │ rps_cpus │   [Mbps]  │
├──────────┼──────────┼───────────┤
│        0 │        0 │ 743 / 804 │
│        0 │        1 │ 738 / 821 │
│        0 │        2 │     ✓ 940 │
│        0 │        4 │     ✓ 938 │
│        0 │        8 │     ✓ 941 │
├──────────┼──────────┼───────────┤
│        1 │        0 │       829 │
│        1 │        1 │       829 │
│        1 │        2 │     ✓ 942 │
│        1 │        4 │     ✓ 941 │
│        1 │        8 │     ✓ 941 │
├──────────┼──────────┼───────────┤
│        2 │        0 │     ✓ 942 │
│        2 │        1 │       926 │
│        2 │        2 │     ✓ 942 │
│        2 │        4 │     ✓ 942 │
│        2 │        8 │     ✓ 941 │
├──────────┼──────────┼───────────┤
│        4 │        0 │     ✓ 941 │
│        4 │        1 │       925 │
│        4 │        2 │     ✓ 941 │
│        4 │        4 │     ✓ 941 │
│        4 │        8 │     ✓ 941 │
├──────────┼──────────┼───────────┤
│        8 │        0 │     ✓ 942 │
│        8 │        1 │       925 │
│        8 │        2 │     ✓ 941 │
│        8 │        4 │     ✓ 942 │
│        8 │        8 │     ✓ 942 │
└──────────┴──────────┴───────────┘

Ref: fcbd39689e ("bcm53xx: enable & setup packet steering")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 57cad53f4e)
2022-09-01 12:46:37 +02:00
Rafał Miłecki 30bce90d84 bcm4908: prepare for Asus GT-AX6000 support
It isn't tested & Linux DT will surely need more work.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 3f2b2fe084)
2022-09-01 12:46:37 +02:00
Rafał Miłecki b8b5ee12cd bcm4908: backport bcmbca DT patches queued for 5.20
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit d63ef7c90f)
2022-09-01 12:46:37 +02:00
Rafał Miłecki a79a21b509 bcm53xx: backport DT changes from 5.17 & 5.18
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit a721fb9f83)
2022-09-01 12:46:37 +02:00
Rafał Miłecki 3abed8406b bcm53xx: drop dead upgrade code
platform_nand_pre_upgrade() is gone since commit 790692dde2
("base-files: drop support for the platform_nand_pre_upgrade()").

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit a6dc0f680d)
2022-09-01 12:46:37 +02:00
Jo-Philipp Wich caa43f4428 firewall4: update to latest Git HEAD
f5fcdcf cli: introduce test mode and refuse firewall restart on errors
a540f6d fw4: fix cosmetic issue with per-ruleset and per-table include paths
695e821 doc: fix swapped include positions in nftables.d README

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit ab31ffc425)
2022-09-01 12:41:00 +02:00
Jo-Philipp Wich 26b436e2a2 ucode: update to latest Git HEAD
344fa9e lib: extend render() to support function values
89452b2 lib: improve getenv() and split() implementations

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
[fix commit subject]
(cherry picked from commit c6d6306827)
2022-08-31 23:06:01 +02:00
Felix Fietkau 0588b124e4 mac80211: disable ft-over-ds by default
Testing has shown it to be very unreliable in variety of configurations.
It is not mandatory, so let's disable it by default until we have a better
solution.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit 2984a04206)
2022-08-30 10:59:51 +02:00
Thibaut VARÈNE dced5f2c95 ramips: define Yuncore AX820 switch LEDs
This patch defines the two switch LED to bring them under user control.

Fixes: 158a5af801 ("ramips: improve YunCore AX820 LEDs")
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
[rmilecki: leave "label"s in place]
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 7bee10a7d2)
2022-08-29 16:23:26 +02:00
Albin Hellström e497818e18 ath79: add support for Extreme Networks WS-AP3805i
Specifications:

 - SoC:    Qualcomm Atheros QCA9557-AT4A
 - RAM:	   2x 128MB Nanya NT5TU64M16HG
 - FLASH:  64MB - SPANSION FL512SAIFG1
 - LAN:    Atheros AR8035-A (RGMII GbE with PoE+ IN)
 - WLAN2:  Qualcomm Atheros QCA9557 2x2 2T2R
 - WLAN5:  Qualcomm Atheros QCA9882-BR4A 2x2 2T2R
 - SERIAL: UART pins at J10 (115200 8n1)
           Pinout is 3.3V - GND - TX - RX (Arrow Pad is 3.3V)
 - LEDs: Power (Green/Amber)
   WiFi 5 (Green)
   WiFi 2 (Green)
 - BTN: Reset

Installation:

1. Download the OpenWrt initramfs-image.

Place it into a TFTP server root directory and rename it to 1D01A8C0.img
Configure the TFTP server to listen at 192.168.1.66/24.

2. Connect the TFTP server to the access point.

3. Connect to the serial console of the access point.

Attach power and interrupt the boot procedure when prompted.

Credentials are admin / new2day

4. Configure U-Boot for booting OpenWrt from ram and flash:

 $ setenv boot_openwrt 'setenv bootargs; bootm 0xa1280000'
 $ setenv ramboot_openwrt 'setenv serverip 192.168.1.66;
   tftpboot 0x89000000 1D01A8C0.img; bootm'
 $ setenv bootcmd 'run boot_openwrt'
 $ saveenv

5. Load OpenWrt into memory:

 $ run ramboot_openwrt

6. Transfer the OpenWrt sysupgrade image to the device.

Write the image to flash using sysupgrade:

 $ sysupgrade -n /path/to/openwrt-sysupgrade.bin

Signed-off-by: Albin Hellström <albin.hellstrom@gmail.com>
[rename vendor - minor style fixes - update commit message]
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit f8c87aa2d2)
2022-08-29 02:37:36 +02:00
Hauke Mehrtens 9703a2adcc kernel: Refresh on 5.10.138
Refresh all patches on top of kernel 5.10.138.

The following patches were applied upstream:
 bcm27xx/patches-5.10/950-0311-drm-vc4-Adopt-the-dma-configuration-from-the-HVS-or-.patch
 bcm27xx/patches-5.10/950-0317-vc4_hdmi-Remove-firmware-logic-for-MAI-threshold-set.patch
 bcm27xx/patches-5.10/950-0346-drm-vc4-A-present-but-empty-dmas-disables-audio.patch
 bcm27xx/patches-5.10/950-0354-drm-vc4-Add-the-2711-HVS-as-a-suitable-DMA-node.patch
 bcm27xx/patches-5.10/950-0413-drm-vc4-hdmi-Don-t-access-the-connector-state-in-res.patch
 bcm27xx/patches-5.10/950-0505-vc4-drm-Avoid-full-hdmi-audio-fifo-writes.patch
 bcm27xx/patches-5.10/950-0512-vc4-drm-vc4_plane-Remove-subpixel-positioning-check.patch
 bcm27xx/patches-5.10/950-0560-drm-vc4-drv-Remove-the-DSI-pointer-in-vc4_drv.patch
 bcm27xx/patches-5.10/950-0561-drm-vc4-dsi-Use-snprintf-for-the-PHY-clocks-instead-.patch
 bcm27xx/patches-5.10/950-0562-drm-vc4-dsi-Introduce-a-variant-structure.patch
 bcm27xx/patches-5.10/950-0565-drm-vc4-Correct-pixel-order-for-DSI0.patch
 bcm27xx/patches-5.10/950-0566-drm-vc4-Register-dsi0-as-the-correct-vc4-encoder-typ.patch
 bcm27xx/patches-5.10/950-0567-drm-vc4-Fix-dsi0-interrupt-support.patch
 bcm27xx/patches-5.10/950-0568-drm-vc4-Add-correct-stop-condition-to-vc4_dsi_encode.patch
 bcm27xx/patches-5.10/950-0647-drm-vc4-Fix-timings-for-interlaced-modes.patch
 bcm27xx/patches-5.10/950-0695-drm-vc4-Fix-margin-calculations-for-the-right-bottom.patch

Upstream sets the pixel clock to 340MHz now, do not set it to 600MHz any more.
 bcm27xx/patches-5.10/950-0576-drm-vc4-hdmi-Raise-the-maximum-clock-rate.patch

Fixes: 89956c6532 ("kernel: bump 5.10 to 5.10.138")
Fixes: 4209c33ae2 ("kernel: bump 5.10 to 5.10.137")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-08-28 16:56:01 +02:00
Hauke Mehrtens 251336639c mbedtls: update to version 2.28.1
Changelog: https://github.com/Mbed-TLS/mbedtls/releases/tag/v2.28.1
This release of Mbed TLS provides bug fixes and minor enhancements. This
release includes fixes for security issues.

The build problem was reported upstream:
https://github.com/Mbed-TLS/mbedtls/issues/6243

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit f3870546a5)
2022-08-28 12:46:44 +02:00
Petr Štetiar dddf01c508 Revert "mediatek: mt7622: fix banana pi r64 wps button"
This reverts commit 5a81e00063 as it was
backported upstream in commit a1e238690916 ("arm64: dts: mt7622: fix
BPI-R64 WPS button").

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-08-28 08:47:17 +02:00
John Audia 89956c6532 kernel: bump 5.10 to 5.10.138
All patches automatically rebased.

Signed-off-by: John Audia <therealgraysky@proton.me>
(cherry picked from commit fc89ec0692)
2022-08-28 07:24:59 +02:00
Petr Štetiar 4209c33ae2 kernel: bump 5.10 to 5.10.137
Removed following upstreamed patch:

 * bcm53xx: 081-next-ARM_dts_BCM53015-add-mr26.patch

All other patches automagically rebased.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit d1163fd13f)
2022-08-28 07:24:59 +02:00
Etienne Champetier a901a13505 iptables: default to ip(6)tables-nft when using buildroot
35fec487e3 fixed opkg usage,
but when using buildroot we were still defaulting to
ip(6)tables-legacy

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
(cherry picked from commit 0c8d7e34ab)
2022-08-28 00:41:40 +02:00
Arınç ÜNAL d1f14d17aa ramips: fix GB-PC1 and GB-PC2 device support
Change switch port labels to ethblack & ethblue.
Change lan1 & lan2 LEDs to ethblack_act & ethblue_act and fix GPIO pins.
Add the external phy with ethyellow label on the GB-PC2 devicetree.
Do not claim rgmii2 as gpio, it's used for ethernet with rgmii2 function.
Enable ICPlus PHY driver for IP1001 which GB-PC2 has got.
Update interface name and change netdev function.
Enable lzma compression to make up for the increased size of the kernel.
Make spi flash bindings on par with mainline Linux to fix read errors.

Tested on GB-PC2 by Petr.

Tested-by: Petr Louda <petr.louda@outlook.cz>
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
(cherry picked from commit 4807bd6a00)
2022-08-26 22:30:56 +02:00
Joerg Werner 0197cc553a hostapd: fix WPA3 enterprise keys and ciphers
WPA3 enterprise requires group_mgmt_cipher=BIP-GMAC-256 and if 802.11r is
active also wpa_key_mgmt FT-EAP-SHA384. This commit also requires
corresponding changes in netifd.

Signed-off-by: Joerg Werner <schreibubi@gmail.com>
(cherry picked from commit 9fbb76c047)
2022-08-26 22:30:56 +02:00
Hauke Mehrtens 567f64df57 iwinfo: update to latest HEAD
0dad3e6 Add support for CCMP-256 and GCMP-256 ciphers

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit cc6a323e23)
2022-08-26 22:30:56 +02:00
Hauke Mehrtens f543588812 iproute2: Fix KERNEL_INCLUDE in SDK
In the SDK the folder $(LINUX_DIR)/user_headers/include does not exist,
but it more or less contains the same content as
$(LINUX_DIR)/include/uapi which also exists in the SDK.

Since iproute2 commit 1d819dcc741e ("configure: fix parsing issue on
include_dir option") it checks if this folder exists and aborts the
build if it does not exists.
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=1d819dcc741e25958190e31f8186c940713fa0a8

With this commit the KERNEL_INCLUDE variable points to a valid folder
with the kernel include headers. I am not sure if they are actually
needed because the build worked before even with an invalid path.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 60738feded)
2022-08-26 22:30:56 +02:00
Hauke Mehrtens 8de88a2aa9 umbim: bump to git HEAD
146bc77 umbim: fix invalid mbim message string encoding

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 90bedc411b)
2022-08-26 22:30:56 +02:00
Felix Fietkau e0832778a3 mt76: update to the latest version
9485e3b47066 mt76: remove q->qid
e5674c4aa402 mt76: mt7921: enable HW beacon filter not depending on PM flag
7fd299e3c921 mt76: mt7921: enable HW beacon filter in the initialization stage
d5459efaaf14 mt76: mt7921: make mt7921_pci_driver static
b8304b456e23 mt76: connac: move tx initialization/cleanup in mt76_connac module
6e0d7077486c mt76: mt7921: reduce log severity levels for informative messages
cb80da974fe6 mt76: mt7921: reduce the mutex lock scope during reset
a2d61f4f4063 mt76: mt7915 add ht mpdu density
08ea730c1130 mt76: add len parameter to __mt76_mcu_msg_alloc signature
60ef85fa352c mt76: introduce MT_RXQ_BAND2 and MT_RXQ_BAND2_WA in mt76_rxq_id
8ccbb38ca6e6 mt76: add phy_idx in mt76_rx_status
eb19ac83c07e mt76: introduce phys array in mt76_dev structure
30887591e3ab mt76: add phy_idx to mt76_wcid
4bf8c20a9524 mt76: convert MT_TX_HW_QUEUE_EXT_PHY to MT_TX_HW_QUEUE_PHY
e6c6bf8cee09 mt76: get rid of mt76_wcid_hw routine
120f73ad992a mediatek: mt76: mac80211: Fix missing of_node_put() in mt76_led_init()
111e92cf8c22 mediatek: mt76: eeprom: fix missing of_node_put() in mt76_find_power_limits_node()
13bedd62ff4a mt76: connac: introduce mt76_connac_reg_map structure
5ec78e1ec43d wifi: mt76: fix reading current per-tid starting sequence number for aggregation

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit ec7d32f376)
2022-08-26 20:24:54 +02:00
Felix Fietkau da3dc96b64 netifd: update to the latest version
76d2d41b7355 interface: fix use-after-free bug when rewriting resolv.conf

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit 31648c4b59)
2022-08-25 21:42:44 +02:00
Hauke Mehrtens 237f8e2cfc netifd: update to git HEAD
87fbefd interface: support "zone" config option
bfa039c netifd: fix WPA3 enterprise ciphers

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry-picked from commit 8008816a2c)
2022-08-25 21:42:34 +02:00
Petr Štetiar 8a9733ee0d rpcd: bump version to 2022-08-24
gcc 10 with -O2 reports following:

 In function ‘strncpy’,
     inlined from ‘rpc_sys_packagelist’ at /opt/devel/openwrt/c-projects/rpcd/sys.c:244:4:
 /usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 128 equals destination size [-Werror=stringop-truncation]
   106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 In function ‘strncpy’,
     inlined from ‘rpc_sys_packagelist’ at /opt/devel/openwrt/c-projects/rpcd/sys.c:227:4:
 /usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 128 equals destination size [-Werror=stringop-truncation]
   106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Since it is not possible to avoid truncation by strncpy, it is necessary
to make sure the result of strncpy is properly NUL-terminated and the
NUL must be inserted explicitly, after strncpy has returned.

References: #10442
Reported-by: Alexey Smirnov <s.alexey@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 34ddd2e545)
2022-08-25 11:05:20 +02:00
Jo-Philipp Wich 8f4a2e4234 rpcd: update to latest Git HEAD
ae5afea ucode: parse ucode plugin scripts in raw mode, init search path

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commit 66a360206e)
2022-08-25 10:33:14 +02:00
Jo-Philipp Wich f92ac40ebd uhttpd: update to latest Git HEAD
e3395cd ucode: initialize search path before VM init
8cb3f85 ucode: initialize default library search path
188dea2 utils: accept '?' as path terminator in uh_path_match()
c5eac5d file: support using dynamic script handlers as error pages
290ff88 relay: trigger close if in header read state with pending data
f9db538 ucode: ignore exit exceptions
8ba0b64 cmake: use variables and find_library for dependency

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commit 4ee77cfcfa)
2022-08-25 10:32:34 +02:00
Jo-Philipp Wich d4f20964ff ucode: update to latest Git HEAD
bcdd2cb examples: add module search path initialization and freeing
ee1946f ubus: fix GCC strncpy() truncation warning
131d99c lib: introduce three new functions call(), loadstring() and loadfile()
8e8dae0 lib: introduce helper function for indenting error messages
476f02b lib: simplify include_path()
d84b53a source: avoid null pointer access in uc_source_runpath_set()
c43a54f types: gracefully handle unpatched upvalues in ucv_free()
e2fb11a README.md: document gc() function
b41cb2d main: introduce -g flag to allow enabling periodic gc from cli
85d7885 lib: implement gc()
47528f0 vm: support automatic periodic GC runs
381cc75 types: treat vm->exports as GC roots
fcc49e6 compiler: add import statement support for dynamic extensions
c9442f1 vm: introduce new I_DYNLOAD opcode
b6fd8a2 lib: internally expose new uc_require_library() helper
a486adc vm: don't treat offset 0 special for exceptions
41ccd19 compiler: don't treat offset 0 special at syntax errors
b4a3f68 compiler: improve formatting of nested syntax error messages
5d5dadc program: remove now unused uc_program_export_lookup()
304995b compiler: rework export index allocation
506cc37 compiler: fix deriving module path from source runpath
54b7fac compiler: enforce stricter module compilation rules
d62e372 vm: don't initialize upvalues for module functions
b856602 program: add serialization and deserialization for module function flag
d7d1bde compiler: add a flag denoting module functions
156d584 treewide: unexport libucode internal functions
10e056d compiler: add support for import/export statements
862e49d compiler: resolve predeclared upvalues
78dfb08 compiler: require a name in function declarations
afd78c1 compiler: fix reported source position in inc/dec operator error
e1c3db0 tests: run_tests.sh: substitute dynamic test directory path in output
3c168b5 vm, cli: move search path into global configuration structure
d85bc71 vm: introduce import and export opcodes
365782e vm: honor constant flag of objects and arrays
6becc64 vm: transparently resolve upvalue references
3418967 vm: gracefully handle unresolved upvalues
50cf572 program: add function to globally lookup exported name
c441f65 program: add infrastructure to handle multiple sources per program
2322468 program: fix reporting source position of first instruction
9c9a9ec program: fix en/decoding debuginfo upvalue slots in precompiled bytecode
41114a0 source: add tracking of exported symbols
70ae304 lib: honor constant flag of arrays
3c104f5 types: resolve upvalue references on stringification
3a6f9cb types: add ability to mark array and object values as constant
b738f3a lexer: recognize module related keywords
03c8e4b lexer: rewrite token scanner
fd433aa lexer: fix parsing with disabled block left stripping
557577a rtnl: fix parsing/creation of IFLA_AF_SPEC RTA for the AF_BRIDGE family
35c6b73 compiler: fix stack mismatch on continue statements nested in switches
f673096 uloop: end uloop on exceptions in managed code
2e5426c ubus: end uloop on exceptions in managed code
c024270 rtnl: expose IFLA_STATS64 contents
d3c58c0 rtnl: expose ifinfomsg.ifi_change member
c4dde50 rtnl: update NETLINK_GET_STRICT_CHK socket flag with every request
7ef0d02 nl80211: fix NL80211_SURVEY_INFO_NOISE datatype
9a2e592 compiler: fix stack mismatch on nonmatching switch statements with locals
03c8ca5 nl80211: recognize further NL80211_STA_INFO_* NLAs
a1ed566 struct: add optional offset argument to `unpack()`
230e595 rtnl: fix segmentation fault on parsing linkinfo RTA without data
523566d rtnl: zero request message headers
56be30d rtnl: fix premature netlink reply receive abort
1347440 rtnl: avoid stray "netlink: %d bytes leftover after parsing attributes."
44b0a3b struct: fix packing `*` format after other repeated formats

Also package uloop binding module which has been introduced by a previous
ucode update and introduce a host build with the basic set of modules.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 3446d32616)
2022-08-25 10:31:56 +02:00
Jo-Philipp Wich 469db326ac nftables: fix parsing date expressions
Musl libc does not support the non-POSIX "%F" format for strptime() so
replace all occurrences of it with an equivalent "%Y-%m-%d" format.

Fixes: #10419
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commit e6e4f97999)
2022-08-25 10:30:46 +02:00
Jo-Philipp Wich fd268e3973 firewall4: update to latest Git HEAD
a4484d4 fw4: support automatic includes
ca7e3a1 fw4: honour enabled option of include sections
5a02f74 tests: add missing fs.stat) mock data for `nf_conntrack_dummy`
111a7f7 fw4: don't inherit zone family from ct helpers

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit fe86b2ffaa)
2022-08-25 10:19:46 +02:00
Christian Marangi 296c9aeb39
ipq806x: add missing scaling_available_frequencies for dedicated cpufreq
Add missing scaling_available_frequencies sysfs entry for dedicated
cpufreq driver.
This sysfs entry is not standard and each cpufreq driver needs to
provide it and declare it in the cpufreq driver struct attr.

Fixes: 5dbbefcbcc ("ipq806x: introduce dedicated krait cpufreq")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
[ fix conflict by dropping 5.15 patch not present in openwrt-22.03 ]
(cherry picked from commit d6994c53cd)
2022-08-21 18:59:52 +02:00
Sultan Alsawaf 97213c7335 mac80211: parse the correct set of HE capabilities for AP mode
It is common for 802.11ax NICs to support more than just AP mode, which
results in there being a distinct set of HE capabilities for each mode. As
(bad) luck would have it, iw prints out info for each HE mode in sequential
order according to `enum nl80211_iftype`, and AP mode isn't always first.

As a result, the wrong set of HE capabilities can be parsed if an AP NIC
supports station (managed) mode or any other mode preceding AP mode, since
only the first set of HE capabilities printed by iw is parsed from awk's
output.

This has a noticeable impact on beamforming for example, since managed mode
usually doesn't have beamformer capabilities enabled, while AP mode does.
Hostapd won't be set up with the configs to enable beamformer capabilities
in this scenario, causing hostapd to disable beamforming to HE stations
even when it's supported by the AP.

Always parse the correct set of HE capabilities for AP mode to fix this.
This is achieved by trimming all of iw's output prior to the AP mode
capabilities, which ensures that the first set of HE capabilities are
always for AP mode.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
(cherry picked from commit f338f76a66)
2022-08-21 15:54:22 +02:00
Mikhail Zhilkin ecd8f7e294
ramips: get MAC addr from the encrypted partition (WG4хх223)
This commit resolves #10062. Adds decryption of the Arcadyan WG4xx223
configuration partition (board_data)to get base MAC address from it.
As a result, after this change the hack with saving MAC addressees to
u-boot-env before installation of OpenWrt is no longer necessary.

This is necessary for the following devices:
- Beeline Smartbox Flash (Arcadyan WG443223)
- MTS WG430223 (Arcadyan WG430223)

Example:
+----------------+-------------------+------------------------+
|                |    MTS WG430223   | Beeline Smartbox Flash |
+----------------+-------------------+------------------------+
| base mac (mtd) | A4:xx:xx:51:xx:F4 | 30:xx:xx:51:xx:06      |
| label          | A4:xx:xx:51:xx:F4 | 30:xx:xx:51:xx:09      |
| LAN            | A4:xx:xx:51:xx:F6 | 30:xx:xx:51:xx:09      |
| WAN            | A4:xx:xx:51:xx:F4 | 30:xx:xx:51:xx:06      |
| WLAN_2g        | A4:xx:xx:51:xx:F5 | 30:xx:xx:51:xx:07      |
| WLAN_5g        | A6:xx:xx:21:xx:F5 | 32:xx:xx:41:xx:07      |
+----------------+-------------------+------------------------+

Collected statistic shows that the 2-4th bits of the 7th byte of the
WLAN_5g MAC are the constant (see #10062 for more details):
- Beeline Smartbox Flash - 100
- MTS WG430223 - 010

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
(cherry picked from commit a6b0d08060)
2022-08-19 14:44:44 +02:00
Mikhail Zhilkin 290ace2fe6
base-files: add mtd_get_mac_encrypted_arcadyan function
Some Arcadyan devices (e.g. MTS WG430223) keep their config in encrypted
mtd. This adds mtd_get_mac_encrypted_arcadyan() function to get the MAC
address from the encrypted partition. Function uses uencrypt utility for
decryption (and openssl if the uencrypt wasn't found).

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
(cherry picked from commit 12c971bc26)
2022-08-19 14:44:35 +02:00
Eneas U de Queiroz d94a28f7d2
uencrypt: add package to decrypt WG4хх223 config
This adds a simple AES-128-CBC encryption/decryption program using
either wolfSSL or OpenSSL as backend to decrypt Arcadyan WG4xx223
configuration partitions.  The ipk size is 3,355 bytes.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit bc43ad88ed)
2022-08-19 14:44:07 +02:00
Hans Dedecker bfb37d363c odhcp6c: update to git HEAD
7d21e8d dhcpv6: add option to ignore stateless advertise

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
(cherry picked from commit a23d132cff)
2022-08-18 00:16:35 +02:00