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

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