Merge branch 'ac/gsm' into 'main'

core/wwan: Ensure correct conditions before signal emission

See merge request NetworkManager/NetworkManager!1071
This commit is contained in:
Ana Cabral
2022-01-25 16:18:59 +00:00
2 changed files with 9 additions and 2 deletions

View File

@@ -170,10 +170,13 @@ modem_new_config(NMModem *modem,
NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE(self); NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE(self);
NMDevice *device = NM_DEVICE(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) { 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); nm_device_devip_set_failed(device, addr_family, failure_reason_i);
return; return;
} }

View File

@@ -650,6 +650,10 @@ _ppp_mgr_callback(NMPppMgr *ppp_mgr, const NMPppMgrCallbackData *callback_data,
* We will emit it together with stage3. */ * We will emit it together with stage3. */
continue; 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]) if (callback_data->data.ip_changed_x[IS_IPv4])
_ppp_maybe_emit_new_config(self, IS_IPv4 ? AF_INET : AF_INET6); _ppp_maybe_emit_new_config(self, IS_IPv4 ? AF_INET : AF_INET6);
} }