core: fix case of unmanaged device being managed at startup (rh #494527)

device_start() would unconditionally transition the device to UNAVAILABLE
no matter what the initial managed setting was.  There was a short window
for a race with HAL where device_start() wouldn't get canceled if HAL
was starting up in parallel with NetworkManager.
This commit is contained in:
Dan Williams
2009-04-11 08:05:11 -04:00
parent 85baf9ace8
commit e5146b8f82

View File

@@ -150,7 +150,10 @@ device_start (gpointer user_data)
NMDevice *self = NM_DEVICE (user_data);
self->priv->start_timer = 0;
nm_device_state_changed (self, NM_DEVICE_STATE_UNAVAILABLE, NM_DEVICE_STATE_REASON_NOW_MANAGED);
if (self->priv->managed)
nm_device_state_changed (self, NM_DEVICE_STATE_UNAVAILABLE, NM_DEVICE_STATE_REASON_NOW_MANAGED);
else
nm_info ("(%s): now unmanaged", nm_device_get_iface (self));
return FALSE;
}