diff options
| author | Christian Breunig <christian@breunig.cc> | 2026-11-07 22:13:12 +0100 |
|---|---|---|
| committer | Christian Breunig <christian@breunig.cc> | 2026-11-07 22:19:52 +0100 |
| commit | 744ca463ba23ca6a8b79640178990c564690d6af (patch) | |
| tree | 8f7101dd0ea5a2957360a453730b688f0dcea5a1 /python | |
| parent | 9babe4468dec43d2df20488bacd3877d77c42b35 (diff) | |
| download | vyos-1x-744ca463ba23ca6a8b79640178990c564690d6af.tar.gz vyos-1x-744ca463ba23ca6a8b79640178990c564690d6af.zip | |
wwan: T9388: apply a bearer's settings only for the static method
Every bearer method other than dhcp was handled as static, including
unknown. ModemManager reports the address and prefix of such a bearer as
"--", which was then installed as "--/--" and aborted the commit.
Only a static bearer is applied now, any other method falls back to the
DHCP(v6) client or SLAAC, and a placeholder address or prefix counts as
missing.
Diffstat (limited to 'python')
| -rw-r--r-- | python/vyos/ifconfig/wwan.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/python/vyos/ifconfig/wwan.py b/python/vyos/ifconfig/wwan.py index 2904a124a..3d64609de 100644 --- a/python/vyos/ifconfig/wwan.py +++ b/python/vyos/ifconfig/wwan.py @@ -91,13 +91,13 @@ class WWANIf(Interface): bearer, method = self._wait_for_bearer_method(family) - if method in (None, '', '--', 'dhcp'): + if method != 'static': self._forget_bearer(family) return super().add_addr(addr, vrf_changed=vrf_changed) - # method == 'static' (the common case for QMI raw-ip modems): apply - # the bearer's own address/gateway/DNS directly, since a DHCP(v6) - # client would never get a reply from it. + # The common case for QMI raw-ip modems: apply the bearer's own + # address/gateway/DNS directly, since a DHCP(v6) client would never + # get a reply from it. return self._apply_bearer_address(bearer, family) def set_ipv6_autoconf(self, autoconf): @@ -116,7 +116,7 @@ class WWANIf(Interface): # genuinely needs host-side SLAAC (e.g. Intel XMM-based). bearer, method = self._wait_for_bearer_method('ipv6') - if method in (None, '', '--', 'dhcp'): + if method != 'static': self._forget_bearer('ipv6') return super().set_ipv6_autoconf(autoconf) @@ -144,7 +144,7 @@ class WWANIf(Interface): complete = True for family in families: bearer, method = self._wait_for_bearer_method(family) - if method not in (None, '', '--', 'dhcp'): + if method == 'static': if not self._apply_bearer_address(bearer, family): self._forget_bearer(family) complete = False @@ -200,7 +200,8 @@ class WWANIf(Interface): prefix = f'bearer.{family}-config' address = dict_search(f'{prefix}.address', bearer) plen = dict_search(f'{prefix}.prefix', bearer) - if not address or not plen: + # mmcli reports a field it does not know as '--' + if not address or not plen or '--' in (address, plen): return False cidr = f'{address}/{plen}' |
