aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem-simple.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mm-iface-modem-simple.c')
-rw-r--r--src/mm-iface-modem-simple.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/mm-iface-modem-simple.c b/src/mm-iface-modem-simple.c
index f1967b65..bfc0e260 100644
--- a/src/mm-iface-modem-simple.c
+++ b/src/mm-iface-modem-simple.c
@@ -541,10 +541,20 @@ connection_step (ConnectionContext *ctx)
mm_info ("Simple connect state (%d/%d): Connect",
ctx->step, CONNECTION_STEP_LAST);
- mm_bearer_connect (ctx->bearer,
- (GAsyncReadyCallback)connect_bearer_ready,
- ctx);
- return;
+ /* Wait... if we're already using an existing bearer, we need to check if it is
+ * already connected; and if so, just don't do anything else */
+ if (mm_bearer_get_status (ctx->bearer) != MM_BEARER_STATUS_CONNECTED) {
+ mm_bearer_connect (ctx->bearer,
+ (GAsyncReadyCallback)connect_bearer_ready,
+ ctx);
+ return;
+ }
+
+ mm_dbg ("Bearer at '%s' is already connected...",
+ mm_bearer_get_path (ctx->bearer));
+
+ /* Fall down to next step */
+ ctx->step++;
case CONNECTION_STEP_LAST:
mm_info ("Simple connect state (%d/%d): All done",