summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-09-30 20:09:52 +0200
committerGitHub <noreply@github.com>2026-09-30 20:09:52 +0200
commit04843e7a470c36a11a51ee865da96d167295f4aa (patch)
tree51697ce3b21136f1a42b08b7520bed789260be9d /python
parent888bc31365e22b4f04ac0a8692406c83d0b6d074 (diff)
parent5299606d0e6adf5f522cc6cbfb35ea39fc138bb4 (diff)
downloadvyos-1x-04843e7a470c36a11a51ee865da96d167295f4aa.tar.gz
vyos-1x-04843e7a470c36a11a51ee865da96d167295f4aa.zip
Merge pull request #5521 from yzguy/wwan-always-prenegotiate-eps-bearer
wwan: T9326: always pre-negotiate the attach-time PDN type before connect
Diffstat (limited to 'python')
-rw-r--r--python/vyos/utils/wwan.py27
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