modemmanager: set allowedmode to 'any' if nothing is configured
authorFlorian Eckert <fe@dev.tdt.de>
Thu, 18 Jan 2024 15:08:59 +0000 (16:08 +0100)
committerFlorian Eckert <fe@dev.tdt.de>
Fri, 19 Jan 2024 07:31:17 +0000 (08:31 +0100)
The modem saves the permitted technology configuration in the modem
itself. If the technology configuration is deleted in the uci, this is
not passed on to the modem. This means that the previously saved
technology configuration is remains in the modem and is therefore still
active. By setting the technology to 'any', if no option is set, all
technologies are allowed again.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
net/modemmanager/Makefile
net/modemmanager/files/modemmanager.proto

index 2b455512f5f2c8989ff6f8997a7882ece224aab7..f327b148605042126e4062bf626ccb4630bf990f 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=modemmanager
 PKG_SOURCE_VERSION:=1.22.0
-PKG_RELEASE:=7
+PKG_RELEASE:=8
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/ModemManager.git
index afbe2397ff18e7d112662f66fc869efbea8a546d..671f0db15beb47a0be54a692ba3e9380fbc93997 100755 (executable)
@@ -523,7 +523,9 @@ proto_modemmanager_setup() {
        modemmanager_check_state "$device" "${modemstatus}" "$pincode"
        [ "$?" -ne "0" ] && return 1
 
-       [ -z "${allowedmode}" ] || {
+       if [ -z "${allowedmode}" ]; then
+               modemmanager_set_allowed_mode "$device" "$interface" "any"
+       else
                case "$allowedmode" in
                        "2g")
                                modemmanager_set_allowed_mode "$device" \
@@ -548,7 +550,7 @@ proto_modemmanager_setup() {
                esac
                # check error for allowed_mode and preferred_mode function call
                [ "$?" -ne "0" ] && return 1
-       }
+       fi
 
        # always cleanup before attempting a new connection, just in case
        modemmanager_cleanup_connection "${modemstatus}"