summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam Smith <adamsmith@yzguy.io>2026-09-17 01:53:39 +0000
committerChristian Breunig <christian@breunig.cc>2026-09-22 20:14:30 +0200
commit97d46c8fe96bcf4b7deb89a4cedce2da2c73dbf4 (patch)
treebe670b974af73c783e398a85b3d4c502837ecfa4 /src
parent2b06da194c61091511a6eaf995b5186a919a4a7b (diff)
downloadvyos-1x-97d46c8fe96bcf4b7deb89a4cedce2da2c73dbf4.tar.gz
vyos-1x-97d46c8fe96bcf4b7deb89a4cedce2da2c73dbf4.zip
wwan: T9326: fix dual-stack connect on single-PDN-context networks
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. This means "interfaces wwan <name>" with both * "address dhcp" * "address dhcpv6" or "ipv6 address autoconf" never gets an IPv6 address on such networks, even though the modem and network both genuinely support dual-stack. Authored-by: Adam Smith <adamsmith@yzguy.io> Co-Authored-by: Christian Breunig <christian@breunig.cc>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/interfaces_wwan.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/conf_mode/interfaces_wwan.py b/src/conf_mode/interfaces_wwan.py
index 59303196d..87ced1c6f 100755
--- a/src/conf_mode/interfaces_wwan.py
+++ b/src/conf_mode/interfaces_wwan.py
@@ -195,6 +195,23 @@ def apply(wwan):
if 'authentication' in wwan:
options += ',user={username},password={password}'.format(**wwan['authentication'])
+ # 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 ip_type in ('ipv4v6', 'ipv6'):
+ call(f'{base_cmd} --3gpp-set-initial-eps-bearer-settings="{options}"',
+ stdout=DEVNULL)
+
command = f'{base_cmd} --simple-connect="{options}"'
call(command, stdout=DEVNULL)