summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-09-24 21:48:13 +0200
committerChristian Breunig <christian@breunig.cc>2026-09-24 21:48:13 +0200
commit79738ffce99c0d4afd313355df8ca12200e6800c (patch)
tree6d7b64255d33b2ce40e46db68138cd08b52f3cf3 /src/conf_mode
parent9c88884a67c01b4e5d74872abee41820a8f65331 (diff)
downloadvyos-1x-79738ffce99c0d4afd313355df8ca12200e6800c.tar.gz
vyos-1x-79738ffce99c0d4afd313355df8ca12200e6800c.zip
wwan: T9350: wait for the modem to become dialable, not merely listed
A modem is on the bus while still probing, so a dial could start too early and leave the interface without a session until something re-dialled it.
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/interfaces_wwan.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/conf_mode/interfaces_wwan.py b/src/conf_mode/interfaces_wwan.py
index dd5a1e8c3..1f7407a9d 100755
--- a/src/conf_mode/interfaces_wwan.py
+++ b/src/conf_mode/interfaces_wwan.py
@@ -30,6 +30,7 @@ from vyos.configverify import verify_mtu_ipv6
from vyos.ifconfig import WWANIf
from vyos.utils.network import is_wwan_connected
from vyos.utils.process import cmdl
+from vyos.utils.process import is_systemd_service_active
from vyos.utils.wwan import clear_admin_disconnected
from vyos.utils.wwan import connect_options
from vyos.utils.wwan import modem_connect
@@ -126,9 +127,17 @@ def apply(wwan):
# ModemManager is required to dial WWAN connections - one instance is
# required to serve all modems. Activate ModemManager on first invocation
# of any WWAN interface.
- start_modem_manager()
-
- if 'shutdown_required' in wwan or (not is_wwan_connected(wwan['ifname'])):
+ #
+ # Tearing an interface down never dials, so it must not wait for the modem
+ # to become dialable either - the hardware being gone is a common reason to
+ # remove the configuration in the first place, and waiting out the budget
+ # for a modem that will never appear would stall the commit for nothing.
+ if 'deleted' not in wwan and 'disable' not in wwan:
+ start_modem_manager(wwan['ifname'])
+
+ # No ModemManager, no session to drop - and nothing that would answer
+ if is_systemd_service_active(service_name) and (
+ 'shutdown_required' in wwan or not is_wwan_connected(wwan['ifname'])):
# Number of bearers is limited - always disconnect first
modem_disconnect(wwan['ifname'])