summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorAdam Smith <adamsmith@yzguy.io>2026-10-16 14:45:59 +0000
committerAdam Smith <adamsmith@yzguy.io>2026-10-18 09:50:03 +0000
commit22165e8624c12e826ec860d1720ccea31b5cc834 (patch)
treec825133a0b9c771b61a977b200cb4fe8e40b8f1a /python
parentdb29bdc899e4b4c27569d3c5705839b924393fe6 (diff)
downloadvyos-1x-22165e8624c12e826ec860d1720ccea31b5cc834.tar.gz
vyos-1x-22165e8624c12e826ec860d1720ccea31b5cc834.zip
wwan: T9388: request an IPv6 bearer for autoconf without an address node
"ipv6 address autoconf" lives below "ipv6", so an interface which only gets its address by SLAAC has no "address" node at all. connect_options() only worked out the IP type when that node existed and fell back to ipv4 otherwise, which dialled an IPv4-only bearer and left the interface without any IPv6. Read the address list with a default instead. All other combinations of dhcp, dhcpv6 and autoconf give the same IP type as before.
Diffstat (limited to 'python')
-rw-r--r--python/vyos/utils/wwan.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/python/vyos/utils/wwan.py b/python/vyos/utils/wwan.py
index cf7d7b143..7b7c31d02 100644
--- a/python/vyos/utils/wwan.py
+++ b/python/vyos/utils/wwan.py
@@ -175,14 +175,14 @@ def connect_options(config: dict) -> str:
context - both are key-mangled the same way, so both are accepted here.
"""
ip_type = 'ipv4'
+ address = config.get('address', [])
slaac = dict_search('ipv6.address.autoconf', config) != None
- if 'address' in config:
- if 'dhcp' in config['address'] and ('dhcpv6' in config['address'] or slaac):
- ip_type = 'ipv4v6'
- elif 'dhcpv6' in config['address'] or slaac:
- ip_type = 'ipv6'
- elif 'dhcp' in config['address']:
- ip_type = 'ipv4'
+ if 'dhcp' in address and ('dhcpv6' in address or slaac):
+ ip_type = 'ipv4v6'
+ elif 'dhcpv6' in address or slaac:
+ ip_type = 'ipv6'
+ elif 'dhcp' in address:
+ ip_type = 'ipv4'
options = f'ip-type={ip_type},apn=' + config['apn']
if 'authentication' in config: