[MM] [PATCH] broadband-bearer, icera: fix CID matching for unsolicited IPDPACT responses



---
 plugins/icera/mm-broadband-modem-icera.c |    2 +-
 src/mm-broadband-bearer.c                |    7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/plugins/icera/mm-broadband-modem-icera.c b/plugins/icera/mm-broadband-modem-icera.c
index 60777c7..8b9008c 100644
--- a/plugins/icera/mm-broadband-modem-icera.c
+++ b/plugins/icera/mm-broadband-modem-icera.c
@@ -280,7 +280,7 @@ ipdpact_received (MMAtSerialPort *port,
         return;
 
     /* Setup context */
-    ctx.cid = 0;
+    ctx.cid = cid;
     ctx.status = MM_BROADBAND_BEARER_ICERA_CONNECTION_STATUS_UNKNOWN;
 
     switch (status) {
diff --git a/src/mm-broadband-bearer.c b/src/mm-broadband-bearer.c
index 8d46e31..bd38ec3 100644
--- a/src/mm-broadband-bearer.c
+++ b/src/mm-broadband-bearer.c
@@ -670,13 +670,13 @@ dial_3gpp_ready (MMBroadbandModem *modem,
     if (!MM_BROADBAND_BEARER_GET_CLASS (ctx->self)->dial_3gpp_finish (ctx->self,
                                                                       res,
                                                                       &error)) {
+        /* Clear CID when it failed to connect. */
+        ctx->self->priv->cid = 0;
         g_simple_async_result_take_error (ctx->result, error);
         detailed_connect_context_complete_and_free (ctx);
         return;
     }
 
-    /* Keep CID around while connected */
-    ctx->self->priv->cid = ctx->cid;
 
     if (MM_BROADBAND_BEARER_GET_CLASS (ctx->self)->get_ip_config_3gpp &&
         MM_BROADBAND_BEARER_GET_CLASS (ctx->self)->get_ip_config_3gpp_finish) {
@@ -732,6 +732,9 @@ initialize_pdp_context_ready (MMBaseModem *modem,
         return;
     }
 
+    /* Keep CID around after initializing the PDP context in order to
+     * handle corresponding unsolicited PDP activation responses. */
+    ctx->self->priv->cid = ctx->cid;
     MM_BROADBAND_BEARER_GET_CLASS (ctx->self)->dial_3gpp (ctx->self,
                                                           ctx->modem,
                                                           ctx->primary,
-- 
1.7.7.3



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]