From 9e995905082cddbdfc85892b205f8f898cb5d437 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Thu, 31 Aug 2017 18:23:33 +0200 Subject: [PATCH 1/2] device: don't promote slave devices to managed Previously, if a master device had internal state 'managed', we would promote the slave to 'managed' as well. However, - if the slave is 'external', it should stay as is because we don't want to start managing it - if the slave is 'assumed', it will become managed when the activation succeeds, so it's not necessary to do it here Fixes: 850c977953e4de3c8bbee64a3d2e8726c971761c --- src/devices/nm-device.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index b7ff53d406..273e89d017 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -3812,13 +3812,6 @@ nm_device_slave_notify_enslave (NMDevice *self, gboolean success) priv->is_enslaved = TRUE; - if ( NM_IN_SET_TYPED (NMDeviceSysIfaceState, - priv->sys_iface_state, - NM_DEVICE_SYS_IFACE_STATE_EXTERNAL, - NM_DEVICE_SYS_IFACE_STATE_ASSUME) - && nm_device_sys_iface_state_get (priv->master) == NM_DEVICE_SYS_IFACE_STATE_MANAGED) - nm_device_sys_iface_state_set (self, NM_DEVICE_SYS_IFACE_STATE_MANAGED); - _notify (self, PROP_MASTER); _notify (priv->master, PROP_SLAVES); } else if (activating) { From 981f90e32425bc9cf2086cdd9b160942a5a6f8ee Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Thu, 31 Aug 2017 18:29:42 +0200 Subject: [PATCH 2/2] device: don't release external slaves on state change If the slave is 'external' we should never touch it, in particular we should not release the link from its master; we only have to remove it from master's list. https://bugzilla.redhat.com/show_bug.cgi?id=1442361 --- src/devices/nm-device.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 273e89d017..ec36197561 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -3578,6 +3578,7 @@ slave_state_changed (NMDevice *slave, { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); gboolean release = FALSE; + gboolean configure; _LOGD (LOGD_DEVICE, "slave %s state change %d (%s) -> %d (%s)", nm_device_get_iface (slave), @@ -3601,8 +3602,11 @@ slave_state_changed (NMDevice *slave, } if (release) { + configure = priv->sys_iface_state == NM_DEVICE_SYS_IFACE_STATE_MANAGED + && nm_device_sys_iface_state_get (slave) != NM_DEVICE_SYS_IFACE_STATE_EXTERNAL; + nm_device_master_release_one_slave (self, slave, - priv->sys_iface_state == NM_DEVICE_SYS_IFACE_STATE_MANAGED, + configure, reason); /* Bridge/bond/team interfaces are left up until manually deactivated */ if ( c_list_is_empty (&priv->slaves)