summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-10-23 15:27:24 +0200
committerThomas Haller <thaller@redhat.com>2019-10-23 15:27:24 +0200
commite346bdc550323167604b328d39626d0f0dd82092 (patch)
tree79c6aa0aaf7a88ae10d1eb755058defddb5ff2f3
parent7efc3c479f8abd46d601105c1f618d529352a86a (diff)
parentae21d851e8d02fbe087f7cc0b7205193ba7118ac (diff)
downloadNetworkManager-e346bdc550323167604b328d39626d0f0dd82092.tar.gz
device/wwan: merge branch 'afaure/protect-self-variable'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/303
-rw-r--r--src/devices/wwan/nm-modem-broadband.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/devices/wwan/nm-modem-broadband.c b/src/devices/wwan/nm-modem-broadband.c
index 9910ffdb27..eb5b21aa7e 100644
--- a/src/devices/wwan/nm-modem-broadband.c
+++ b/src/devices/wwan/nm-modem-broadband.c
@@ -341,16 +341,26 @@ connect_ready (MMModemSimple *simple_iface,
GAsyncResult *res,
NMModemBroadband *self)
{
- ConnectContext *ctx = self->_priv.ctx;
+ ConnectContext *ctx;
GError *error = NULL;
NMModemIPMethod ip4_method = NM_MODEM_IP_METHOD_UNKNOWN;
NMModemIPMethod ip6_method = NM_MODEM_IP_METHOD_UNKNOWN;
+ MMBearer *bearer;
- self->_priv.bearer = mm_modem_simple_connect_finish (simple_iface, res, &error);
+ bearer = mm_modem_simple_connect_finish (simple_iface, res, &error);
+
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+ g_error_free (error);
+ return;
+ }
+
+ ctx = self->_priv.ctx;
if (!ctx)
return;
+ self->_priv.bearer = bearer;
+
if (!self->_priv.bearer) {
if (g_error_matches (error, MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_SIM_PIN) ||
(g_error_matches (error, MM_CORE_ERROR, MM_CORE_ERROR_UNAUTHORIZED) &&
@@ -619,7 +629,7 @@ connect_context_step (NMModemBroadband *self)
mm_modem_simple_connect (self->_priv.simple_iface,
ctx->connect_properties,
- NULL,
+ ctx->cancellable,
(GAsyncReadyCallback) connect_ready,
self);
break;