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
This commit is contained in:
Aleksander Morgado
2023-11-28 14:01:24 +00:00
parent e35655b364
commit 3ccf847284
+8
View File
@@ -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;