aboutsummaryrefslogtreecommitdiff
path: root/src/mm-bearer-qmi.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksandermj@chromium.org>2023-10-26 12:24:10 +0000
committerAleksander Morgado <aleksander@aleksander.es>2023-10-27 11:34:26 +0200
commit10b8ee4cb9829e311a2e9be4e8516af2ac869632 (patch)
treef4cc0bb2f4be7336ebeb5cda0971be5b34e3c5a9 /src/mm-bearer-qmi.c
parentd0f97a4c62ccab064ea305d3367ac4c020a39f78 (diff)
modem-helpers-qmi: avoid "ip-version-mismatch" error if possible
Based on the WDS client being connected, we'll convert this error into "IPv4 only allowed" or "IPv6 only allowed".
Diffstat (limited to 'src/mm-bearer-qmi.c')
-rw-r--r--src/mm-bearer-qmi.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/mm-bearer-qmi.c b/src/mm-bearer-qmi.c
index 33b88606..97f9c079 100644
--- a/src/mm-bearer-qmi.c
+++ b/src/mm-bearer-qmi.c
@@ -1213,6 +1213,7 @@ register_for_wds_indication (ConnectContext *ctx,
static GError *
error_from_start_network_output (MMBearerQmi *self,
+ gboolean running_ipv4,
QmiMessageWdsStartNetworkOutput *output)
{
QmiWdsCallEndReason cer;
@@ -1224,7 +1225,9 @@ error_from_start_network_output (MMBearerQmi *self,
&verbose_cer_type,
&verbose_cer_reason,
NULL)) {
- return mm_error_from_wds_verbose_call_end_reason (verbose_cer_type, verbose_cer_reason, self);
+ return mm_error_from_wds_verbose_call_end_reason (verbose_cer_type, verbose_cer_reason,
+ running_ipv4 ? MM_BEARER_IP_FAMILY_IPV4 : MM_BEARER_IP_FAMILY_IPV6,
+ self);
}
if (qmi_message_wds_start_network_output_get_call_end_reason (
@@ -1277,7 +1280,7 @@ start_network_ready (QmiClientWds *client,
mm_obj_msg (self, "couldn't start %s network: %s", ctx->running_ipv4 ? "IPv4" : "IPv6", error->message);
if (g_error_matches (error, QMI_PROTOCOL_ERROR, QMI_PROTOCOL_ERROR_CALL_FAILED)) {
g_clear_error (&error);
- error = error_from_start_network_output (self, output);
+ error = error_from_start_network_output (self, ctx->running_ipv4, output);
}
}
}
@@ -1374,8 +1377,14 @@ packet_service_status_indication_cb (QmiClientWds *client,
&verbose_cer_type,
&verbose_cer_reason,
NULL)) {
- /* Create MM error based on the verbose call end reason details */
- connection_error = mm_error_from_wds_verbose_call_end_reason (verbose_cer_type, verbose_cer_reason, self);
+ /* Create MM error based on the verbose call end reason details. There is no real
+ * need for now to provide the correct IP type associated to the QMI WDS client
+ * that received the indication, because the type of errors that need this info
+ * would happen upon a Start Network operation, not after the modem has been
+ * connected. */
+ connection_error = mm_error_from_wds_verbose_call_end_reason (verbose_cer_type, verbose_cer_reason,
+ MM_BEARER_IP_FAMILY_NONE,
+ self);
} else if (qmi_indication_wds_packet_service_status_output_get_call_end_reason (
output,
&cer,