From 79738ffce99c0d4afd313355df8ca12200e6800c Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Thu, 24 Sep 2026 21:48:13 +0200 Subject: 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. --- src/conf_mode/interfaces_wwan.py | 15 ++++++++++++--- src/services/vyos-netlinkd | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'src') 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']) diff --git a/src/services/vyos-netlinkd b/src/services/vyos-netlinkd index 4c91561d2..d6cc3c379 100755 --- a/src/services/vyos-netlinkd +++ b/src/services/vyos-netlinkd @@ -292,7 +292,7 @@ def _wwan_dial(ifname: str, config: dict) -> None: try: # A session cannot be dialled without ModemManager. It is normally # started by conf_mode, but recover here too in case it died. - start_modem_manager() + start_modem_manager(ifname) if not _wwan_dial_wanted(ifname): return None -- cgit v1.2.3