aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* tools: add gnulib sourceMichael Pratt2023-05-044-0/+81
| | | | | | | | | | | | | | | | By having a local copy of gnulib, we can: import the latest macro fixes into any package, get rid of some statically stored macros that were otherwise missing, bootstrap GNU tools with the latest relevant source without having to wait for a release or rely on git submodules, and possibly more... The patch assists in bootstrapping by ignoring the building of po files using gettext, and also to allow a user-defined path to a program to include parameters. Signed-off-by: Michael Pratt <mcpratt@pm.me>
* autotools: add list of fake paths to toolsMichael Pratt2023-05-041-0/+2
| | | | | | | A list that can be used by some packages in order to force the skipping of every execution of autoreconf. Signed-off-by: Michael Pratt <mcpratt@pm.me>
* prereq-build: add check for true and falseMichael Pratt2023-05-042-0/+15
| | | | | | | | | | | | | | | | Some uses cases, like with autotools, need a path for 'true' if we use them to force something to skip. This will work by default on Linux hosts, and require MacOS hosts to get coreutils, which is currently installed in the CI for 'macos-latest' host. In the future, prereq stage can be reworked to search for the actual binary instead of relying on env. Signed-off-by: Michael Pratt <mcpratt@pm.me>
* lantiq: xrx200: mark subtarget as source-onlyAleksander Jan Bajkowski2023-05-041-1/+1
| | | | | | | | | The current problems blocking the switch to the kernel 5.15 are related to the GSWIP driver. This driver is only used by the xrx200 subtarget. The other subtargets are unaffected by this problem. Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
* Revert "lantiq: mark source only"Aleksander Jan Bajkowski2023-05-041-1/+1
| | | | | | | | This reverts commit c306385474f4f183657423be708ac7813ee38b47. It should be sufficient to disable only the xrx200 subtarget. Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
* kernel: improve handling of CONFIG_IO_URINGTony Ambardar2023-05-0315-15/+2
| | | | | | | | | | | | | | | | | | | | | | Kernel setting CONFIG_IO_URING supports high-performance I/O for file access and servers, generally for more performant platforms, and adds ~45 KB to kernel sizes. The need for this on less "beefy" devices is questionable, as is the size cost considering many platforms have kernel size limits which require tricky repartitioning if outgrown. The size cost is also large relative to the ~180 KB bump expected between major OpenWRT kernel releases. No OpenWrt packages have hard dependencies on this; samba4 and mariadb can take advantage if available (+KERNEL_IO_URING:liburing) but otherwise build and work fine. Since CONFIG_IO_URING is already managed via the KERNEL_IO_URING setting in Config-kernel.in (default Y), remove it from those target configs which unconditionally enable it, and update the defaults to enable it conditionally only on more powerful 64-bit x86 and arm devices. It may still be manually enabled as needed for high-performance custom builds. Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
* kernel: fix handling of CONFIG_DYNAMIC_DEBUGTony Ambardar2023-05-039-9/+2
| | | | | | | | | | Since CONFIG_DYNAMIC_DEBUG is already managed via the KERNEL_DYNAMIC_DEBUG setting in Config-kernel.in (default N), remove or disable it in target configs which unconditionally enable it, along with the related setting CONFIG_DYNAMIC_DEBUG_CORE. This saves several KB in the kernels for ipq40xx, ipq806x, filogic, mt7622, qoriq, and sunxi. Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
* kernel: bump 5.15 to 5.15.110John Audia2023-05-033-4/+4
| | | | | | | | | | All patches automatically rebased. Build system: x86_64 Build-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod Run-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod Signed-off-by: John Audia <therealgraysky@proton.me>
* ipq40xx: convert AVM FRITZ!Repeater 3000 to DSANick Hainke2023-05-033-2/+22
| | | | | | Convert the repeater to DSA. Signed-off-by: Nick Hainke <vincent@systemli.org>
* kernel: Activate CONFIG_SLAB_FREELIST_RANDOMHauke Mehrtens2023-05-032-2/+2
| | | | | | | | | | | | | This activates CONFIG_SLAB_FREELIST_RANDOM. This option make the free list less predictable. This makes it harder to exploit heap based security vulnerabilities. This adds a little bit more code to the kernel and a small additional compute overhead. This option is activated in Debian by default. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* omap: mark source onlyPaul Spooren2023-05-031-1/+1
| | | | | | | | The target is currently broken with Kernel 5.15 and no one in sight to fix it. Instead of stalling the next release indefinitely, make it source only and see if someone steps up to fix it. Signed-off-by: Paul Spooren <paul.spooren@rhebo.com>
* lantiq: mark source onlyPaul Spooren2023-05-031-1/+1
| | | | | | | | The target is currently broken with Kernel 5.15 and no one in sight to fix it. Instead of stalling the next release indefinitely, make it source only and see if someone steps up to fix it. Signed-off-by: Paul Spooren <paul.spooren@rhebo.com>
* uboot-mediatek: fixes build when nmbm enabledChukun Pan2023-05-021-3/+3
| | | | | | | | | | The image_header_t typedef has been removed from uboot v2023.01 [1], replaced with legacy struct. [1] https://github.com/u-boot/u-boot/commit/f3543e69442ca393e52df253d9c5d45bc189d471 Fixes: 3d5c542 ("uboot-mediatek: update to U-Boot 2023.01") Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
* uboot-mediatek: fix CONFIG_TEXT_BASE variableChukun Pan2023-05-027-12/+12
| | | | | | | | | | CONFIG_SYS_TEXT_BASE has been renamed to CONFIG_TEXT_BASE in uboot v2023.01 [1], fixes all this variable. [1] https://github.com/u-boot/u-boot/commit/984639039f4cfe32ec2cc531d6ace05326ac49eb Fixes: 3d5c5427 ("uboot-mediatek: update to U-Boot 2023.01") Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
* uboot-mediatek: remove duplicate config in mt7986Chukun Pan2023-05-022-14/+5
| | | | | | Some config was written twice by mistake, fix it. Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
* ramips: mt7621: add support for Cudy X6 v2Felix Baumann2023-05-025-52/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename existing device to v1 and create common .dtsi Difference to v1: 16MB Flash Specifications: SoC: MediaTek MT7621 RAM: 256 MB Flash: 16 MB (SPI NOR, XM25QH128C on my device) WiFi: MediaTek MT7915E Switch: 1 WAN, 4 LAN (Gigabit) Buttons: Reset, WPS LEDs: Two Power LEDs (blue and red; together they form purple) Power: DC 12V 1A center positive Serial: 115200 8N1 C440 - (3V3 - GND - RX - TX) - C41 | v1 and v2 (P - G - R - T) | v2 labels them on the board Installation: Download and flash the manufacturer's built OpenWrt image available at http://www.cudytech.com/openwrt_software_download Install the new OpenWrt image via luci (System -> Backup/Flash firmware) Be sure to NOT keep settings. Recovery: Loads only signed manufacture firmware due to bootloader RSA verification Serve tftp-recovery image as /recovery.bin on 192.168.1.88/24 Connect to any lan ethernet port Power on the device while holding the reset button Wait at least 8 seconds before releasing reset button for image to download MAC addresses as verified by OEM firmware: use address source LAN f4:a4:54:86:75:a2 label WAN f4:a4:54:86:75:a3 label + 1 2g f4:a4:54:86:75:a2 label 5g f6:a4:54:b6:75:a2 label + LA-Bit set + 4th oktet increased The label MAC address is found in bdinfo 0xde00. Signed-off-by: Felix Baumann <felix.bau@gmx.de>
* realtek: hpe_1920-8g: add phy-handle for SFP portsJan Hoffmann2023-04-302-0/+4
| | | | | | | | The switch driver actually expects every port to have a PHY handle, and several branches in the code determine if a port is valid by checking for a non-zero phy field. Signed-off-by: Jan Hoffmann <jan@3e8.eu>
* mediatek: no longer hard-code WAN PHY of Netgear WAX206Daniel Golle2023-04-301-2/+2
| | | | | | | | The RealTek 2.5G PHY providing the WAN port of the Netgear WAX206 has previously been hard-coded in the device tree. Now that the PHY can be probed correctly also via Clause-45 MDIO, use that instead. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* generic: net: phy: realtek: detect early version of RTL8221BDaniel Golle2023-04-301-0/+63
| | | | | | | | | | Early versions (?) of the RTL8221B PHY cannot be identified in a regular Clause-45 bus scan as the PHY doesn't report the implemented MMDs correctly but returns 0 instead. Implement custom identify function using the PKGID instead of iterating over the implemented MMDs to work-around this problem. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* kernel: bump 5.15 to 5.15.109John Audia2023-04-3011-61/+12
| | | | | | | | | | | | | | | Removed upstreamed: backport-5.15/743-v6.3-0005-net-dsa-b53-mmap-add-phy-ops.patch[1] All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.109&id=357fa038d93d0e9159a0f0d45bae0f8654e2ade5 Build system: x86_64 Build-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod Run-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod Signed-off-by: John Audia <therealgraysky@proton.me>
* kernel: bump 5.10 to 5.10.179John Audia2023-04-309-16/+16
| | | | | | All patches automatically rebased. Signed-off-by: John Audia <therealgraysky@proton.me>
* ramips: add factory image for TP-Link EC330-G5u v1Mikhail Zhilkin2023-04-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds factory.bin image for TP-Link EC330-G5u v1. This allows to install OpenWrt without connecting a serial cable (UART). Installation using factory image -------------------------------- Tested with "3.16.0 0.9.1 v6037.0 Build 191016 Rel.30619nb" TP-Link firmware. 1. Login to the router web interface (http://192.168.0.1/ by default) and save running config to "conf.bin" file 2. Open configuration file in any TP-Link config editor (e.g. https://jahed.github.io/tp-link-config-editor/) 3. Find "DeviceInfo" section and insert a new string "<Description val="Modem Router`telnetd -p 1023 -l login`" />" according to the following example: <DeviceInfo> ... <Description val="Modem Router`telnetd -p 1023 -l login`" /> ... </DeviceInfo> 4. Save configuration file and upload changed configuration using stock firmware interface 5. Login using telnet to IP:192.168.0.1 (Username:admin, password:1234) 6. Run "cat /proc/mtd | grep mtd7" a. If the result is 'mtd7: 03000000 00020000 "rootfs" 03400000', then install stock firmware using web interface to toggle booted firmware image from "os1" to "os0" b. If the result is 'mtd7: 03000000 00020000 "rootfs" 00400000', then all is ok, go to the next step 7. Set up a tftp server with OpenWrt factory.bin image (IP:192.168.0.100 in this example) 8. Login using telnet to 192.168.0.1 9. Download OpenWrt factory.bin image from the tftp server: cd /tmp tftp -g -r factory.bin 192.168.0.100 10. Write OpenWrt factory.bin image: dd if=/tmp/factory.bin of=/dev/mtdblock1 11. Power cycle the router Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
* ramips: TP-Link EC330-G5u v1: switch to mac-address-asciiMikhail Zhilkin2023-04-293-10/+26
| | | | | | | | | | | | | The TP-Link EC330-G5u v1 router has MAC address that stored in factory mtd in ascii format. This commit makes the router use of "mac-address-ascii" in dts. After the change: 1. All MAC addresses are explicitly assigned in dts (the workarounds in network scripts are no longer needed); 2. gmac0 (eth0) MAC address is no longer random. Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
* ramips: lzma-loader: Refactor loaderAntonio Vázquez2023-04-299-87/+75
| | | | | | | | | * Delete unused lantiq makefile * Delete redundant makefiles and unify them into the main makefile * Refactor and unify board code into a single file * Add support and review subtarget specific board support Signed-off-by: Antonio Vázquez <antoniovazquezblanco@gmail.com>
* ramips: add support for D-Link DAP-1620 B1Rani Hod2023-04-296-8/+198
| | | | | | | | | | | | | | | | | | | | | | | | | The DAP-1620 rev B is a wall-plug AC1300 repeater. Specifications: - MT7621AT, 256 MiB RAM, 16 MiB SPI NOR - MT7615DN 2x2 802.11n +2x2 802.11ac (DBDC) - Ethernet: 1 port 10/100/1000 - Status LEDs (1x red+green) - LED RSSI bargraph (2x green, 1x red+green) Installation: - Keep reset button pressed during plug-in - Web Recovery Updater is at 192.168.0.50 - Upload factory.bin, confirm flashing (seems to work best with Chromium-based browsers) Revert to OEM firmware: - tail -c+117 DAP1620B1_FW212B03.bin | \ openssl aes-256-cbc -d -md md5 -out decrypted.bin \ -k 905503a4e0c3cd3c1ce062246de427a68962347e - flash decrypted.bin via D-Link Web Recovery Signed-off-by: Rani Hod <rani.hod@gmail.com>
* bcm27xx: Deactivate CONFIG_OABI_COMPATHauke Mehrtens2023-04-292-2/+0
| | | | | | | | | | | | | This deactivates the kernel option CONFIG_OABI_COMPAT. The old arm OABI is not needed any more, we compile all applications for the new ARM EABI. This reduces the attack surface of the kernel syscall interface. On all other targets CONFIG_OABI_COMPAT is already deactivated. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* kernel: Deactivate CONFIG_COMPATHauke Mehrtens2023-04-293-11/+0
| | | | | | | | | | | | | | This deactivates the CONFIG_COMPAT kernel option. With CONFIG_COMPAT the kernel will provide syscall interfaces for arm32 binaries in addition to the interfaces needed for arm64 binaries. In OpenWrt the complete userspace is compiled for this specific architecture and support for 32 bit ARM applications is not needed. This reduces the size and the attack surface for the systems. On all other targets CONFIG_COMPAT is already deactivated. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* kernel: Deactivate CONFIG_LEGACY_PTYSHauke Mehrtens2023-04-2912-24/+0
| | | | | | | | | The legacy (BSD) PTY support could open security problems in a system, We do not need them in OpenWrt, deactivate this option in all targets. Debian also deactivates this option. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* kernel: Activate CONFIG_ARM64_SW_TTBR0_PANHauke Mehrtens2023-04-294-4/+0
| | | | | | | | | | | | | This activates the CONFIG_ARM64_SW_TTBR0_PAN option for all arm64 kernels by default. The CONFIG_ARM64_SW_TTBR0_PAN option prevents the kernel form accessing user space memory directly. This makes it harder to exploit the kernel. This is activated by default and was already activate on all other arm64 targets before. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* kernel: Activate CONFIG_HARDENED_USERCOPY for all targetsHauke Mehrtens2023-04-294-4/+0
| | | | | | | | | | | | | | This activates CONFIG_HARDENED_USERCOPY for the remaining targets. This adds additional checks in the copy_from_user() and copy_to_user() functions. This was not activated for ARCHS38 before because of a bug in the Linux kernel 5.4 till 5.14, which as fixed and is described here: https://github.com/foss-for-synopsys-dwc-arc-processors/linux/issues/15 I do not know why this was deactivated for mt7629 and rockchip. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* ramips: mt7621: add support for ZyXEL WSM20Andreas Böhler2023-04-297-2/+324
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ZyXEL WSM20 aka Multy M1 is a cheap mesh router system by ZyXEL based on the MT7621 CPU. Specifications ============== SoC: MediaTek MT7621AT (880MHz) RAM: 256MiB Flash: 128MiB NAND Wireless: 802.11ax (2x2 MT7915E DBDC) Ethernet: 4x 10/100/1000 (MT7530) Button: 1x WPS, 1x Reset, 1x LED On/Off LED: 7 LEDs (3x white, 2x red, 2x green) MAC address assignment ====================== The MAC address assignment follows stock: The label MAC address is the LAN MAC address, the WAN address is read from flash. The WiFi MAC addresses are set in userspace to label MAC + 1 and label MAC + 2. Installation (web interface) ============================ The device is cloud-managed, but there is a hidden local firmware upgrade page in the OEM web interface. The device has to be registered in the cloud in order to be able to access this page. The system has a dual firmware design, there is no way to tell which firmware is currently booted. Therefore, an -initramfs version is flashed first. 1. Log into the OEM web GUI 2. Access the hidden upgrade page by navigating to https://192.168.212.1/gui/#/main/debug/firmwareupgrade 3. Upload the -initramfs-kernel.bin file and flash it 4. Wait for OpenWrt to boot and log in via SSH 5. Transfer the sysupgrade file via SCP 6. Run sysupgrade to install the image 7. Reboot and enjoy NB: If the initramfs version was installed in RAS2, the sysupgrade script sets the boot number to the first partition. A backup has to be performed manually in case the OEM firwmare should be kept. Installation (UART method) ========================== The UART method is more difficult, as the boot loader does not have a timeout set. A semi-working stock firmware is required to configure it: 1. Attach UART 2. Boot the stock firmware until the message about failsafe mode appears 3. Enter failsafe mode by pressing "f" and "Enter" 4. Type "mount_root" 5. Run "fw_setenv bootmenu_delay 3" 6. Reboot, U-Boot now presents a menu 7. The -initramfs-kernel.bin image can be flashed using the menu 8. Run the regular sysupgrade for a permanent installation Changing the partition to boot is a bit cumbersome in U-Boot, as there is no menu to select it. It can only be checked using mstc_bootnum. To change it, issue the following commands in U-Boot: nand read 1800000 53c0000 800 mw.b 1800004 1 1 nand erase 53c0000 800 nand write 1800000 53c0000 800 This selects FW1. Replace "mw.b 1800004 1 1" by "mw.b 1800004 2 1" to change to the second slot. Back to stock ============= It is possible to flash back to stock, but a OEM firmware upgrade is required. ZyXEL does not provide the link on its website, but the link can be acquired from the OEM web GUI by analyzing the transferred JSON objects. It is then a matter of writing the firmware to Kernel2 and setting the boot partition to FW2: mtd write zyxel.bin Kernel2 echo -ne "\x02" | dd of=/dev/mtdblock7 count=1 bs=1 seek=4 conv=notrunc Signed-off-by: Andreas Böhler <dev@aboehler.at> Credits to forum users Annick and SirLouen for their initial work on this device
* umbim: include MBIM-provided DNS servers also with DHCP modeLech Perczak2023-04-291-15/+18
| | | | | | | | In MBIM interfaces, DNS servers may be provided out-of-band regardless whether DHCP is used for configuration, or not. Move the DNS configuration outside "if" blocks to support that. Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
* umbim: extract common code from static and dhcp(v6) setup procedureLech Perczak2023-04-291-34/+16
| | | | | | | Beginnings and endings of sub-interface creation procedure were literally duplicates - extract them outside if "if" blocks Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
* umbim: handle MTU configurationLech Perczak2023-04-291-2/+16
| | | | | | | | | Allow setting interface MTU through UCI. If this is not set, use MBIM-provided MTU, if provided through control channel. If separate MTUs are provided for IPv4 and IPv6, apply larger of them. This is very unlikely and possible only for IPv4v6 dual-stack configuration. Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
* umbim: delegate RFC7278 IPv6 prefixes from OOB configLech Perczak2023-04-291-0/+6
| | | | | | | Delegate prefixes received through MBIM control channel the same way, as would be done through DHCP, according to RFC7278. Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
* umbim: drop IP configuration parsing using 'eval'Lech Perczak2023-04-291-1/+0
| | | | | | Finally, when new helper is in use, drop old IP configuration parser. Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
* umbim: support multiple-valued configuration fieldsLech Perczak2023-04-291-10/+32
| | | | | | | | | MBIM supports multiple values for IP address and DNS server, and such configuration is available through output of MBIM. Use new helper method to support adding multiple addresses and DNS servers to static interfaces for both IPv4 and IPv6. Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
* umbim: add "_proto_mbim_get_field" helperLech Perczak2023-04-291-0/+12
| | | | | | | | | Add a new helper to extract IP configuration from umbim output. This is required to extract fields which can possibly have multiple values, namely IP addresses and DNS servers, and get rid of primitive parser using 'eval' builtin without support for this. Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
* umbim: log output of 'config' stepLech Perczak2023-04-291-1/+3
| | | | | | | | Display full configuration obtained using MBIM control channel in the log, from umbim output verbatim, for easier troubleshooting, and in preparation for parser refactoring. Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
* umbim: pass ipXtable to child interfacesLech Perczak2023-04-291-2/+8
| | | | | | | | Inspired by commti e51aa699f7ca, allow setting specific routing tables via ip4table and ip6table options, by passing them on child interfaces created by MBIM protocol handler. Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
* umbim: respect 'Enable IPv6 negotiation' optionLech Perczak2023-04-291-0/+4
| | | | | | | Don't bring IPv6 part of interface up if it's disabled, or system does not support it. Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
* umbim: use static config by default, fallback to DHCPLech Perczak2023-04-291-4/+7
| | | | | | | | | Finally, inspired by ModemManager's logic, make static configuration obtained through MBIM control channel, preferred. If IP configuration is not available this way, fallback to DHCP(v6) if enabled, else do not create a sub-interface for unavailable IP type. Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
* umbim: separate DHCPv6 configuration from DHCP(v4)Lech Perczak2023-04-291-3/+4
| | | | | | | | | | Now, that sub-interface setup is split by IP type, and separate checks are performed for DHCP selection, it is possible to control DHCP on v4 an v6 sub-interfaces instantly. Add "dhcpv6" variable, akin to QMI option, to control behaviour of DHCPv6 separately from IPv4 option, which is required for some mobile operators. Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
* umbim: restructure IPv4/IPv6 handlingLech Perczak2023-04-291-29/+25
| | | | | | | | Check whether interface is configured per IP type, not per DHCP. This is preparation to allow fallback to DHCP if static IP configuration is not available, which is the default option for MBIM modems Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
* umbim: inherit firewall zone membership from parent interfaceLech Perczak2023-04-291-0/+6
| | | | | | | | Fix an issue where subinterfaces were not added to the same firewall zone as their parent. Inspired by 64bb88841fb. Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
* umbim: inherit "peerdns" option from parent interfaceLech Perczak2023-04-291-2/+2
| | | | | | | | MBIM protocol handler should intherit "peerdns" options from parent interface on sub-interfaces, otherwise upstream DNS servers are applied regardless of configuration. Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
* umbim: use IP configuration provided by MBIM by defaultLech Perczak2023-04-291-1/+1
| | | | | | | | | | | | Previously, DHCP was used. According to MBIM Specification v1.0 errata 1 [1], section 10.5.20, MBIM_CID_IP_CONFIGURATION, if MBIM information element containing IP configuration is available, host shall use it, and fall back to in-band mechanisms to acquire it therwise - therefore make static configuration the default. [1] https://www.usb.org/document-library/mobile-broadband-interface-model-v10-errata-1-and-adopters-agreement Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
* umbim: detect actual connection IP typeLech Perczak2023-04-291-4/+10
| | | | | | | | | | | | Current implementation needlessly creates both IPv4 and IPv6 sub-interfaces for single-stack IP types. Limit this only to selected IP type. While at that, ensure that IP type is also passed to umbim during "connect" phase. In addition, detect the actual established connection type returned by umbim and set up subinterfaces according to that, not to requested configuration. While at that, allow empty IP type explicitly, interpreted as "any" according to MBIM specification. Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
* umbim: fail connect step immediatelyLech Perczak2023-04-291-3/+6
| | | | | | | | | | | | | Subsequent calls to 'umbim connect' do not have any effect if a failure occured, and in such case an infinite loop without timeout is created, leading to possibility of interface stuck at connecting forever. Drop this loop, and issue MBIM disconnect properly, so netifd can restart from scratch. This issue can be observed with Sierra EM7455 at changing APN, which causes network re-registration by default, and a MBIM transaction timeout, which is resolved on next interface bringup by netifd. Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
* umbim: connect session for only the selected PDP typeLech Perczak2023-04-291-48/+60
| | | | | | | | | Previous implementation automatically set up connections for both IPv4 and IPv6, even if one of them isn't supported. Respect the "pdptype" option in the same way, as it is done for QMI or NCM, and only start the respective PDN sessions, if set. Signed-off-by: Lech Perczak <lech.perczak@gmail.com>