From 1e318bec54da3f37901eadb2a04a4520737eb9a0 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Tue, 26 Sep 2017 09:53:05 +0200 Subject: [PATCH] broadband-bearer: fix object types in connect_3gpp() steps All the steps in the connect_3gpp() sequence are implemented as methods in the MMBroadbandBearer class, and therefore the objects received in the corresponding ready() methods are all bearers, not modems. This issue wasn't found before because the objects received were not really being used after all, as we were relying on the ones kept in the context or lately in the GTask itself. --- src/mm-broadband-bearer.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/mm-broadband-bearer.c b/src/mm-broadband-bearer.c index 5dd34f62..0a0d235e 100644 --- a/src/mm-broadband-bearer.c +++ b/src/mm-broadband-bearer.c @@ -960,17 +960,15 @@ cid_selection_3gpp (MMBroadbandBearer *self, */ static void -get_ip_config_3gpp_ready (MMBroadbandModem *modem, - GAsyncResult *res, - GTask *task) +get_ip_config_3gpp_ready (MMBroadbandBearer *self, + GAsyncResult *res, + GTask *task) { - MMBroadbandBearer *self; DetailedConnectContext *ctx; MMBearerIpConfig *ipv4_config = NULL; MMBearerIpConfig *ipv6_config = NULL; GError *error = NULL; - self = g_task_get_source_object (task); ctx = g_task_get_task_data (task); if (!MM_BROADBAND_BEARER_GET_CLASS (self)->get_ip_config_3gpp_finish (self, @@ -1000,18 +998,16 @@ get_ip_config_3gpp_ready (MMBroadbandModem *modem, } static void -dial_3gpp_ready (MMBroadbandModem *modem, - GAsyncResult *res, - GTask *task) +dial_3gpp_ready (MMBroadbandBearer *self, + GAsyncResult *res, + GTask *task) { - MMBroadbandBearer *self; DetailedConnectContext *ctx; MMBearerIpMethod ip_method = MM_BEARER_IP_METHOD_UNKNOWN; MMBearerIpConfig *ipv4_config = NULL; MMBearerIpConfig *ipv6_config = NULL; GError *error = NULL; - self = g_task_get_source_object (task); ctx = g_task_get_task_data (task); ctx->data = MM_BROADBAND_BEARER_GET_CLASS (self)->dial_3gpp_finish (self, res, &error); @@ -1079,15 +1075,13 @@ dial_3gpp_ready (MMBroadbandModem *modem, } static void -cid_selection_3gpp_ready (MMBroadbandModem *modem, - GAsyncResult *res, - GTask *task) +cid_selection_3gpp_ready (MMBroadbandBearer *self, + GAsyncResult *res, + GTask *task) { - MMBroadbandBearer *self; DetailedConnectContext *ctx; GError *error = NULL; - self = g_task_get_source_object (task); ctx = g_task_get_task_data (task); /* Keep CID around after initializing the PDP context in order to