diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2020-09-07 10:55:02 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2020-09-07 18:26:43 +0000 |
commit | 958ca74391481616db41cd412a9e12556dd21971 (patch) | |
tree | d69a276a1e39fb463f49ec3fffd3aa7f6f724be5 /src/mm-bearer-mbim.c | |
parent | f8eeab21213e4ec487ce3f91b0ca09f11e52cec0 (diff) |
bearer-mbim: avoid attempting to load deactivated IP types
If we're asking for IPv4v6 and we get IPv4-only connected, we
shouldn't attempt to provide IPv6 addressing details in the bearer
object, because we would fallback to say DHCP is needed if we were not
able to load any IPv6 details from the modem.
This is, instead of provinding both IPv4 and IPv6 details:
------------------------------------
Properties | apn: internet
| roaming: allowed
| ip type: ipv4v6
| allowed-auth: none, pap, chap, mschap, mschapv2, eap
------------------------------------
IPv4 configuration | method: static
| address: 10.182.100.233
| prefix: 24
| gateway: 10.182.100.1
| dns: 80.58.61.250, 80.58.61.254
------------------------------------
IPv6 configuration | method: dhcp
| prefix: 0
We should report only IPv4 details:
----------------------------------
Properties | apn: internet
| roaming: allowed
| ip type: ipv4v6
| allowed-auth: none, pap, chap, mschap, mschapv2, eap
----------------------------------
IPv4 configuration | method: static
| address: 10.182.100.233
| prefix: 24
| gateway: 10.182.100.1
| dns: 80.58.61.250, 80.58.61.254
Diffstat (limited to 'src/mm-bearer-mbim.c')
-rw-r--r-- | src/mm-bearer-mbim.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mm-bearer-mbim.c b/src/mm-bearer-mbim.c index b80c1c99..c90a27e5 100644 --- a/src/mm-bearer-mbim.c +++ b/src/mm-bearer-mbim.c @@ -613,6 +613,11 @@ connect_set_ready (MbimDevice *device, "Unknown error: context activation failed"); } } + /* We're now connected, but we may have received an IP type different to the one + * requested (e.g. asking for IPv4v6 but received IPv4 only). Handle that, so that + * the next step getting IP details doesn't get confused. */ + else if (ctx->ip_type != ip_type) + ctx->ip_type = ip_type; } else { /* Prefer the error from the result to the parsing error */ if (!error) |