From e5146b8f82bfb68bcdf43f99dddbfaec516a37a3 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 11 Apr 2009 08:05:11 -0400 Subject: [PATCH] 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. --- src/nm-device.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/nm-device.c b/src/nm-device.c index f29cfa333..1ea77b250 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -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; }