summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-10-09 21:45:23 +0200
committerThomas Haller <thaller@redhat.com>2015-10-09 23:36:36 +0200
commit120847c8a37cdba9116d26891c8dc725ad8d9100 (patch)
treeb2af39d170d6191da0e0a47309c0ff4c2bc962b3
parent9f1eb190f738369c95a5cd94d3a5ad9ff3027da3 (diff)
downloadNetworkManager-120847c8a37cdba9116d26891c8dc725ad8d9100.tar.gz
device: fix wrongly managing external-down device due to not setting EXTERNAL_DOWN
The unmanaged-flag NM_UNMANAGED_EXTERNAL_DOWN is initially set during nm_device_finish_init(). But it was only set if the device was down at that point. If due to a race the platform device was not yet initialized, a later initialization in device_link_changed() would clear NM_UNMANAGED_PLATFORM_INIT. If the device is not external-down (because it was already up during nm_device_finish_init()), the device will be managed right away with reason NM_DEVICE_STATE_REASON_NOW_MANAGED. Together with commit e29ab54335c6a5ef1ce6bac525f1f18a8e81b96e, this is a race that causes a failure to assume the external-down device. https://bugzilla.redhat.com/show_bug.cgi?id=1269199
-rw-r--r--src/devices/nm-device.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index c588ade47f..46bf08b514 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -1146,8 +1146,9 @@ nm_device_finish_init (NMDevice *self)
/* Do not manage externally created software devices until they are IFF_UP */
if ( NM_DEVICE_GET_CLASS (self)->can_unmanaged_external_down (self)
- && !nm_platform_link_is_up (NM_PLATFORM_GET, priv->ifindex)
- && priv->ifindex > 0)
+ && priv->ifindex > 0
+ && ( !priv->up
+ || !priv->platform_link_initialized))
nm_device_set_unmanaged_initial (self, NM_UNMANAGED_EXTERNAL_DOWN, TRUE);
if (priv->master)