diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/vyos/utils/wwan.py | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/python/vyos/utils/wwan.py b/python/vyos/utils/wwan.py index 8ee6a5a9a..cf7d7b143 100644 --- a/python/vyos/utils/wwan.py +++ b/python/vyos/utils/wwan.py @@ -236,23 +236,16 @@ def modem_connect(ifname: str, options: str) -> bool: if modem is None: return False - # Some networks only ever admit a single combined IPv4+IPv6 PDN context per - # APN and reject a standalone IPv6 "Start Network" request outright (QMI - # CallEndReason ip-version-mismatch) once an IPv4 session already exists for - # that APN. ModemManager's --simple-connect with ip-type=ipv4v6 opens two - # separate WDS sessions (one per family) rather than negotiating both - # together, which is what a normal handset attach does and why this is - # invisible on most other devices. - # - # Pre-negotiating the attach-time PDN type upfront avoids the rejection; the - # resulting bearer only sets up what the *next* --simple-connect is allowed - # to request and can't be connected directly, so a failure here isn't fatal - # - unsupported modems simply proceed to --simple-connect exactly as before. - if options.partition('ip-type=')[2].partition(',')[0] in ('ipv6', 'ipv4v6'): - # best effort by definition, so do not report the rejection a modem - # without attach configuration support answers with on every dial - call(f'mmcli --modem {modem} --3gpp-set-initial-eps-bearer-settings="{options}"', - stdout=DEVNULL, stderr=DEVNULL) + # A network only commits to one PDN type per APN at attach time, and + # rejects any later --simple-connect for a family that doesn't match it + # (QMI ip-version-mismatch, T9326) - pre-negotiating it here avoids that. + # The resulting bearer can't be connected directly, so a failure here + # isn't fatal - unsupported modems just proceed to --simple-connect. + call( + f'mmcli --modem {modem} --3gpp-set-initial-eps-bearer-settings="{options}"', + stdout=DEVNULL, + stderr=DEVNULL, + ) command = f'mmcli --modem {modem} --simple-connect="{options}"' return call(command, stdout=DEVNULL) == 0 |
