summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
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: