From d0c2a24b7140e15ba2722f24fbad22a6d94dbab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Tue, 3 Dec 2013 09:37:58 +0100 Subject: [PATCH] device: do not remove software devices on initial disconnected (rh #1035814) When a device is initialized to be managed, it will transition through states unmanaged -> unavailable -> disconnected. We don't want to remove software devices during this initial transition to disconnected, because it prevents auto-activation. Test case: $ nmcli con add type vlan ifname myvlan dev eth0 id 123 NM should immediately create myvlan interface and automatically activate it. https://bugzilla.redhat.com/show_bug.cgi?id=1035814 --- src/devices/nm-device.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 60cbba1e6..578ccb089 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -4429,6 +4429,8 @@ delete_on_deactivate_check_and_schedule (NMDevice *self, int ifindex) return; if (nm_device_get_state (self) == NM_DEVICE_STATE_UNMANAGED) return; + if (nm_device_get_state (self) == NM_DEVICE_STATE_UNAVAILABLE) + return; nm_log_dbg (LOGD_DEVICE, "Schedule cleanup and delete virtual link #%d for [%s]", ifindex, nm_device_get_iface (self)); priv = NM_DEVICE_GET_PRIVATE (self);