summary refs log tree commit diff
path: root/src/devices/wwan
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/wwan')
-rw-r--r--src/devices/wwan/nm-device-modem.c3
-rw-r--r--src/devices/wwan/nm-modem-broadband.c25
-rw-r--r--src/devices/wwan/nm-modem-manager.c3
-rw-r--r--src/devices/wwan/nm-modem.c7
-rw-r--r--src/devices/wwan/nm-wwan-factory.c3
5 files changed, 22 insertions, 19 deletions
diff --git a/src/devices/wwan/nm-device-modem.c b/src/devices/wwan/nm-device-modem.c
index edecd24d..e9c4f02e 100644
--- a/src/devices/wwan/nm-device-modem.c
+++ b/src/devices/wwan/nm-device-modem.c
@@ -18,11 +18,10 @@
  * Copyright (C) 2009 - 2011 Red Hat, Inc.
  */
 
-#include "config.h"
+#include "nm-default.h"
 
 #include <string.h>
 
-#include "nm-default.h"
 #include "nm-device-modem.h"
 #include "nm-modem.h"
 #include "nm-device-private.h"
diff --git a/src/devices/wwan/nm-modem-broadband.c b/src/devices/wwan/nm-modem-broadband.c
index 427f3ed6..6343416c 100644
--- a/src/devices/wwan/nm-modem-broadband.c
+++ b/src/devices/wwan/nm-modem-broadband.c
@@ -18,7 +18,7 @@
  * Copyright (C) 2012 Aleksander Morgado <aleksander@gnu.org>
  */
 
-#include "config.h"
+#include "nm-default.h"
 
 #include <string.h>
 #include <arpa/inet.h>
@@ -26,7 +26,6 @@
 
 #include "nm-modem-broadband.h"
 #include "nm-core-internal.h"
-#include "nm-default.h"
 #include "NetworkManagerUtils.h"
 #include "nm-device-private.h"
 #include "nm-platform.h"
@@ -52,6 +51,7 @@ typedef struct {
 	MMSimpleConnectProperties *connect_properties;
 	GArray *ip_types;
 	guint ip_types_i;
+	guint ip_type_tries;
 	GError *first_error;
 } ConnectContext;
 
@@ -331,11 +331,17 @@ connect_ready (MMModemSimple *simple_iface,
 		} else
 			g_error_free (error);
 
-		/* If the modem/provider lies and the IP type we tried isn't supported,
-		 * retry with the next one, if any.
-		 */
-		ctx->ip_types_i++;
-		connect_context_clear (self);
+		if (ctx->ip_type_tries == 0 && g_error_matches (error, MM_CORE_ERROR, MM_CORE_ERROR_RETRY)) {
+			/* Try one more time */
+			ctx->ip_type_tries++;
+		} else {
+			/* If the modem/provider lies and the IP type we tried isn't supported,
+			 * retry with the next one, if any.
+			 */
+			ctx->ip_types_i++;
+			ctx->ip_type_tries = 0;
+		}
+		connect_context_step (self);
 		return;
 	}
 
@@ -485,9 +491,10 @@ connect_context_step (NMModemBroadband *self)
 			else
 				g_assert_not_reached ();
 
-			nm_log_dbg (LOGD_MB, "(%s): launching connection with ip type '%s'",
+			nm_log_dbg (LOGD_MB, "(%s): launching connection with ip type '%s' (try %d)",
 			            nm_modem_get_uid (NM_MODEM (self)),
-			            nm_modem_ip_type_to_string (current));
+			            nm_modem_ip_type_to_string (current),
+			            ctx->ip_type_tries + 1);
 
 			mm_modem_simple_connect (self->priv->simple_iface,
 			                         ctx->connect_properties,
diff --git a/src/devices/wwan/nm-modem-manager.c b/src/devices/wwan/nm-modem-manager.c
index c28d86ad..79082c41 100644
--- a/src/devices/wwan/nm-modem-manager.c
+++ b/src/devices/wwan/nm-modem-manager.c
@@ -20,14 +20,13 @@
  * Copyright (C) 2009 Canonical Ltd.
  */
 
-#include "config.h"
+#include "nm-default.h"
 
 #include <string.h>
 
 #include <libmm-glib.h>
 
 #include "nm-modem-manager.h"
-#include "nm-default.h"
 #include "nm-dbus-compat.h"
 #include "nm-modem.h"
 #include "nm-modem-broadband.h"
diff --git a/src/devices/wwan/nm-modem.c b/src/devices/wwan/nm-modem.c
index 15104307..c1736ecf 100644
--- a/src/devices/wwan/nm-modem.c
+++ b/src/devices/wwan/nm-modem.c
@@ -19,20 +19,19 @@
  * Copyright (C) 2009 Novell, Inc.
  */
 
-#include "config.h"
+#include "nm-default.h"
+
+#include "nm-modem.h"
 
 #include <string.h>
 
-#include "nm-modem.h"
 #include "nm-core-internal.h"
 #include "nm-platform.h"
 #include "nm-setting-connection.h"
-#include "nm-default.h"
 #include "NetworkManagerUtils.h"
 #include "nm-device-private.h"
 #include "nm-modem-enum-types.h"
 #include "nm-route-manager.h"
-#include "gsystem-local-alloc.h"
 
 G_DEFINE_TYPE (NMModem, nm_modem, G_TYPE_OBJECT)
 
diff --git a/src/devices/wwan/nm-wwan-factory.c b/src/devices/wwan/nm-wwan-factory.c
index 2fd9e0bd..805aea69 100644
--- a/src/devices/wwan/nm-wwan-factory.c
+++ b/src/devices/wwan/nm-wwan-factory.c
@@ -18,7 +18,7 @@
  * Copyright (C) 2014 Red Hat, Inc.
  */
 
-#include "config.h"
+#include "nm-default.h"
 
 #include <string.h>
 #include <gmodule.h>
@@ -29,7 +29,6 @@
 #include "nm-setting-cdma.h"
 #include "nm-modem-manager.h"
 #include "nm-device-modem.h"
-#include "nm-default.h"
 #include "nm-platform.h"
 
 static GType nm_wwan_factory_get_type (void);