mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-05 05:20:32 +01:00
device: fix check on device state in carrier_changed()
The function can now be called on unrealized devices before the initial unmanaged flags are set and for those devices nm_device_get_managed() will return TRUE. Since we only accept states > UNMANAGED, return early when the condition is not met. Fixes the following failed assertion: carrier_changed: assertion 'priv->state >= NM_DEVICE_STATE_UNAVAILABLE' failed https://bugzilla.gnome.org/show_bug.cgi?id=760844
This commit is contained in:
parent
7231626d31
commit
701d98acc5
1 changed files with 1 additions and 5 deletions
|
|
@ -1272,7 +1272,7 @@ carrier_changed (NMDevice *self, gboolean carrier)
|
|||
{
|
||||
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
|
||||
|
||||
if (!nm_device_get_managed (self))
|
||||
if (priv->state <= NM_DEVICE_STATE_UNMANAGED)
|
||||
return;
|
||||
|
||||
nm_device_recheck_available_connections (self);
|
||||
|
|
@ -1304,8 +1304,6 @@ carrier_changed (NMDevice *self, gboolean carrier)
|
|||
}
|
||||
|
||||
if (carrier) {
|
||||
g_warn_if_fail (priv->state >= NM_DEVICE_STATE_UNAVAILABLE);
|
||||
|
||||
if (priv->state == NM_DEVICE_STATE_UNAVAILABLE) {
|
||||
nm_device_queue_state (self, NM_DEVICE_STATE_DISCONNECTED,
|
||||
NM_DEVICE_STATE_REASON_CARRIER);
|
||||
|
|
@ -1324,8 +1322,6 @@ carrier_changed (NMDevice *self, gboolean carrier)
|
|||
update_dynamic_ip_setup (self);
|
||||
}
|
||||
} else {
|
||||
g_return_if_fail (priv->state >= NM_DEVICE_STATE_UNAVAILABLE);
|
||||
|
||||
if (priv->state == NM_DEVICE_STATE_UNAVAILABLE) {
|
||||
if (nm_device_queued_state_peek (self) >= NM_DEVICE_STATE_DISCONNECTED)
|
||||
nm_device_queued_state_clear (self);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue