Blame SOURCES/1002-fix-check-on-master-ac-failure-rh1845018.patch

146a1d
From 39e365733bd3c79c5801d4e6c7a32f133b9af678 Mon Sep 17 00:00:00 2001
146a1d
From: Beniamino Galvani <bgalvani@redhat.com>
146a1d
Date: Mon, 6 Jul 2020 17:30:05 +0200
146a1d
Subject: [PATCH] core: fix check on master active-connection failure
146a1d
146a1d
The previous check was never satisfied, as the device is assigned to
146a1d
the active-connection and realized early. Instead, check the
146a1d
master_ready flag, which tells if the master is ready and, therefore,
146a1d
if the slave has already been added to the master.
146a1d
146a1d
Before this commit, in some cases a device didn't detect that the
146a1d
master failed and kept waiting forever.
146a1d
146a1d
https://bugzilla.redhat.com/show_bug.cgi?id=1845018
146a1d
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/568
146a1d
(cherry picked from commit 0911d2a4ee1c317f455c01cbad048b994f69844d)
146a1d
(cherry picked from commit 223f741810db9e457ec512c7626bf9e65d82a6cb)
146a1d
---
146a1d
 src/nm-active-connection.c | 6 +++---
146a1d
 1 file changed, 3 insertions(+), 3 deletions(-)
146a1d
146a1d
diff --git a/src/nm-active-connection.c b/src/nm-active-connection.c
146a1d
index 08037ebe71..151fb4d939 100644
146a1d
--- a/src/nm-active-connection.c
146a1d
+++ b/src/nm-active-connection.c
146a1d
@@ -810,14 +810,14 @@ master_state_cb (NMActiveConnection *master,
146a1d
                  gpointer user_data)
146a1d
 {
146a1d
 	NMActiveConnection *self = NM_ACTIVE_CONNECTION (user_data);
146a1d
+	NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (self);
146a1d
 	NMActiveConnectionState master_state = nm_active_connection_get_state (master);
146a1d
-	NMDevice *master_device = nm_active_connection_get_device (master);
146a1d
 
146a1d
 	check_master_ready (self);
146a1d
 
146a1d
 	if (   master_state == NM_ACTIVE_CONNECTION_STATE_DEACTIVATING
146a1d
-	    && (!master_device || !nm_device_is_real (master_device))) {
146a1d
-		/* Master failed without ever creating or realizing its device */
146a1d
+	    && !priv->master_ready) {
146a1d
+		/* Master disconnected before the slave was added */
146a1d
 		if (NM_ACTIVE_CONNECTION_GET_CLASS (self)->master_failed)
146a1d
 			NM_ACTIVE_CONNECTION_GET_CLASS (self)->master_failed (self);
146a1d
 	}
146a1d
-- 
146a1d
2.26.2
146a1d