Blame SOURCES/0008-device-avoid-unenslave-on-external-down-rh1357738.patch

a85faa
From 7e96eb5e667d73b3a92e3cbafbe005ddeb4895a3 Mon Sep 17 00:00:00 2001
a85faa
From: Lubomir Rintel <lkundrak@v3.sk>
a85faa
Date: Tue, 30 Aug 2016 19:17:46 +0200
a85faa
Subject: [PATCH] device: don't let external changes cause a release of the
a85faa
 slave
a85faa
a85faa
At this point we don't know if the slave has been using an assumed
a85faa
connection that just vanished -- the best bet is to let the device be.
a85faa
a85faa
If it's meant to be unenslaved, it won't be due to an external event.
a85faa
a85faa
https://bugzilla.redhat.com/show_bug.cgi?id=1357738
a85faa
(cherry picked from commit 3127fb0d17bff0b250218c7bf82b4335b5290825)
a85faa
---
a85faa
 src/devices/nm-device.c | 7 ++++++-
a85faa
 1 file changed, 6 insertions(+), 1 deletion(-)
a85faa
a85faa
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
a85faa
index 1523018..693058e 100644
a85faa
--- a/src/devices/nm-device.c
a85faa
+++ b/src/devices/nm-device.c
a85faa
@@ -2628,6 +2628,7 @@ slave_state_changed (NMDevice *slave,
a85faa
 {
a85faa
 	NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
a85faa
 	gboolean release = FALSE;
a85faa
+	gboolean configure = TRUE;
a85faa
 
a85faa
 	_LOGD (LOGD_DEVICE, "slave %s state change %d (%s) -> %d (%s)",
a85faa
 	       nm_device_get_iface (slave),
a85faa
@@ -2650,8 +2651,12 @@ slave_state_changed (NMDevice *slave,
a85faa
 		release = TRUE;
a85faa
 	}
a85faa
 
a85faa
+	/* Don't touch the device if its state changed externally. */
a85faa
+	if (reason == NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED)
a85faa
+		configure = FALSE;
a85faa
+
a85faa
 	if (release) {
a85faa
-		nm_device_master_release_one_slave (self, slave, TRUE, reason);
a85faa
+		nm_device_master_release_one_slave (self, slave, configure, reason);
a85faa
 		/* Bridge/bond/team interfaces are left up until manually deactivated */
a85faa
 		if (priv->slaves == NULL && priv->state == NM_DEVICE_STATE_ACTIVATED)
a85faa
 			_LOGD (LOGD_DEVICE, "last slave removed; remaining activated");
a85faa
-- 
a85faa
2.7.4
a85faa