summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAna Cabral <30404-acabral@users.noreply.gitlab.freedesktop.org>2022-01-25 16:18:59 +0000
committerAna Cabral <30404-acabral@users.noreply.gitlab.freedesktop.org>2022-01-25 16:18:59 +0000
commita2d2ea6ea6a1b779799fbf030038663ccd4eec2c (patch)
tree48cec5fb0a1296e76f48a9f8ef820945944223f7
parentc6223c5a41fcd3e6aacd6aeda45e7bc1f0f29d72 (diff)
parente2ee0e6a0dc2fc7f1b6acaf8675b577364711894 (diff)
Merge branch 'ac/gsm' into 'main'
core/wwan: Ensure correct conditions before signal emission See merge request NetworkManager/NetworkManager!1071
-rw-r--r--src/core/devices/wwan/nm-device-modem.c7
-rw-r--r--src/core/devices/wwan/nm-modem.c4
2 files changed, 9 insertions, 2 deletions
diff --git a/src/core/devices/wwan/nm-device-modem.c b/src/core/devices/wwan/nm-device-modem.c
index 656fb82613..4a0d9e4435 100644
--- a/src/core/devices/wwan/nm-device-modem.c
+++ b/src/core/devices/wwan/nm-device-modem.c
@@ -170,10 +170,13 @@ modem_new_config(NMModem *modem,
NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE(self);
NMDevice *device = NM_DEVICE(self);
- g_return_if_fail(nm_device_devip_get_state(device, addr_family) == NM_DEVICE_IP_STATE_PENDING);
+ if (nm_device_devip_get_state(device, addr_family) != NM_DEVICE_IP_STATE_PENDING) {
+ _LOGD(LOGD_MB, "retrieving IP configuration while no longer in pending state");
+ return;
+ }
if (error) {
- _LOGW(LOGD_MB | LOGD_IP4, "retrieving IP configuration failed: %s", error->message);
+ _LOGW(LOGD_MB, "retrieving IP configuration failed: %s", error->message);
nm_device_devip_set_failed(device, addr_family, failure_reason_i);
return;
}
diff --git a/src/core/devices/wwan/nm-modem.c b/src/core/devices/wwan/nm-modem.c
index 225eaa6501..a5ee8ce8ed 100644
--- a/src/core/devices/wwan/nm-modem.c
+++ b/src/core/devices/wwan/nm-modem.c
@@ -650,6 +650,10 @@ _ppp_mgr_callback(NMPppMgr *ppp_mgr, const NMPppMgrCallbackData *callback_data,
* We will emit it together with stage3. */
continue;
}
+ if (priv->ip_data_x[IS_IPv4].stage3_on_idle_source) {
+ /* We scheduled already a handler. Let it handle the new configuration. */
+ continue;
+ }
if (callback_data->data.ip_changed_x[IS_IPv4])
_ppp_maybe_emit_new_config(self, IS_IPv4 ? AF_INET : AF_INET6);
}