aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksandermj@chromium.org>2023-11-28 12:47:17 +0000
committerAleksander Morgado <aleksandermj@chromium.org>2023-11-28 14:01:24 +0000
commit3ccf847284e7b946995b2b82cf318c2a4027a24d (patch)
tree377b6ab06a1b2300ef250aa471806698309b1732 /src
parente35655b364d32fce787cd3980c876f3946f82192 (diff)
bearer-mbim: warn and workaround wrong link prefix length in static IPv6 config
Seems to happen with e.g. the Fibocom FM350: # mmcli -b 2 ------------------------------------ IPv6 configuration | method: static | address: 2607:fb90:dd16:d38a:ac39:89f1:67a7:5a9d | prefix: 128 | gateway: 2607:fb90:dd16:d38a:ac39:89f1:67a7:5a01 | dns: fd00:976a::9, fd00:976a::10 | mtu: 1436
Diffstat (limited to 'src')
-rw-r--r--src/mm-bearer-mbim.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mm-bearer-mbim.c b/src/mm-bearer-mbim.c
index 03eb3789..7988a080 100644
--- a/src/mm-bearer-mbim.c
+++ b/src/mm-bearer-mbim.c
@@ -563,6 +563,14 @@ ip_configuration_query_ready (MbimDevice *device,
/* Netmask */
mm_bearer_ip_config_set_prefix (ipv6_config, ipv6address[0]->on_link_prefix_length);
+ /* If the modem has done SLAAC itself, it is never expected to return a /128 prefix,
+ * warn if it happens and workaround it. Use /64 as default. */
+ if ((mm_bearer_ip_config_get_method (ipv6_config) == MM_BEARER_IP_METHOD_STATIC) &&
+ (mm_bearer_ip_config_get_prefix (ipv6_config) == 128)) {
+ mm_obj_warn (self, "unexpected link prefix returned with global IPv6 address (128): ignoring");
+ mm_bearer_ip_config_set_prefix (ipv6_config, 64);
+ }
+
/* Gateway */
if (ipv6configurationavailable & MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_GATEWAY) {
g_autoptr(GInetAddress) gw_addr = NULL;