device: fix check on device state in carrier_changed()
authorBeniamino Galvani <bgalvani@redhat.com>
Tue, 19 Jan 2016 20:20:46 +0000 (21:20 +0100)
committerBeniamino Galvani <bgalvani@redhat.com>
Wed, 20 Jan 2016 08:53:10 +0000 (09:53 +0100)
commit701d98acc5fde5e089a33304e83491350f8656d5
tree6b4586bec5ac96b2dbf73be06beb689665747592
parent7231626d3172aae3d5319bf73920aa5cd3530848
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
src/devices/nm-device.c