From fa6198e36b77dadaeb8110d48ab456b82ce21815 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Tue, 5 Nov 2024 08:55:40 +0100 Subject: [PATCH] modemmanager: reset to 'no' plmn if nothing is configured If a configured 'plmn' is deleted from the configuration between a connection setup, it will continue to be used because the modem remembers it. Therefore, the 'plmn' stored in the modem must be deleted when a new connection is established if it is no longer in the configuration. Signed-off-by: Florian Eckert --- net/modemmanager/files/lib/netifd/proto/modemmanager.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/modemmanager/files/lib/netifd/proto/modemmanager.sh b/net/modemmanager/files/lib/netifd/proto/modemmanager.sh index f5f91c0eae..0aacc9f907 100644 --- a/net/modemmanager/files/lib/netifd/proto/modemmanager.sh +++ b/net/modemmanager/files/lib/netifd/proto/modemmanager.sh @@ -673,11 +673,14 @@ proto_modemmanager_setup() { [ "$?" -ne "0" ] && return 1 fi - [ -z "${plmn}" ] || { + if [ -z "${plmn}" ]; then + modemmanager_set_plmn "$device" "$interface" "" "$force_connection" + [ "$?" -ne "0" ] && return 1 + else echo "starting network registration with plmn '${plmn}'..." modemmanager_set_plmn "$device" "$interface" "$plmn" "$force_connection" [ "$?" -ne "0" ] && return 1 - } + fi # setup connect args; APN mandatory (even if it may be empty) echo "starting connection with apn '${apn}'..." -- 2.30.2