summaryrefslogtreecommitdiff
path: root/interface-definitions/include/source-interface.xml.i
diff options
context:
space:
mode:
authorAdam Smith <adamsmith@yzguy.io>2026-09-29 13:41:40 +0000
committerAdam Smith <adamsmith@yzguy.io>2026-09-29 13:41:40 +0000
commita272bffcf16c6c5ced83fb19a35aa3c78bbf7bff (patch)
tree10962a8ced480e9c5c28749ef37d4a996a6c63c4 /interface-definitions/include/source-interface.xml.i
parentf15b8b2eebd4afa9ece0ed8034f08f279726c854 (diff)
downloadvyos-1x-a272bffcf16c6c5ced83fb19a35aa3c78bbf7bff.tar.gz
vyos-1x-a272bffcf16c6c5ced83fb19a35aa3c78bbf7bff.zip
wwan: T7487: identify modem by port ownership, not interface number
modem_index() in python/vyos/utils/wwan.py derived the ModemManager modem index straight from the interface name (wwan0 -> 0). The kernel-assigned WWAN interface number and ModemManager's own modem index are two independently enumerated values and are not guaranteed to match - on a box with more than one modem, they can enumerate in different orders, so modem index 0 does not necessarily own wwan0. Every function in this module funnels through modem_index() (start_modem_manager, modem_disconnect, modem_connect, and both admin-disconnect marker helpers), and is_wwan_connected() in vyos.utils.network had its own separate copy of the same assumption - so a single reversed enumeration order silently commands the wrong physical modem for every one of them. modem_index() now lists every modem ModemManager currently knows about and returns whichever one actually has ifname in its own port list, instead of assuming the correspondence. A modem that has not shown up on the bus yet looks the same as one that will never exist, so this waits up to the same modem_wait_timeout budget start_modem_manager() already gives a modem to become dialable, then returns None if nothing claimed the interface. is_wwan_connected() now calls the same resolver instead of keeping its own copy of the old assumption. None is a real, expected return now, not just a theoretical one - the three callers that previously assumed modem_index() always produced *a* string (right or wrong) are updated: start_modem_manager() bails out early (matching the tolerance its own caller's w.exists() check already has for hardware that isn't detected yet), modem_disconnect() and modem_connect() treat it as nothing to disconnect / a failed dial, matching each function's own existing return contract. show_wwan.py's modem_info() raises a clear, specific error instead, which its own top-level exception handler already reports cleanly. set_admin_disconnected()/clear_admin_disconnected() only ever used modem_index() to validate the interface name looks like a WWAN interface in the first place, so they're unaffected.
Diffstat (limited to 'interface-definitions/include/source-interface.xml.i')
0 files changed, 0 insertions, 0 deletions