summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2020-07-06 17:30:05 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2020-07-16 13:44:51 +0200
commit893f55e3ec8cc88f97e9f2d9012623e2669e5ba5 (patch)
tree253204ccc6e40c88aa1435a909cd09cc6638f2d1
parent26e97fcd0d4a70e32a484d3bfc57c1802da10554 (diff)
downloadNetworkManager-bg/autoconnect-slaves-pt2-rh1845018.tar.gz
core: fix check on master active-connection failurebg/autoconnect-slaves-pt2-rh1845018
The previous check was never satisfied, as the device is assigned to the active-connection and realized early. Instead, check the master_ready flag, which tells if the master is ready and, therefore, if the slave has already been added to the master. https://bugzilla.redhat.com/show_bug.cgi?id=1845018
-rw-r--r--src/nm-active-connection.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nm-active-connection.c b/src/nm-active-connection.c
index a559cda23b..746430317a 100644
--- a/src/nm-active-connection.c
+++ b/src/nm-active-connection.c
@@ -810,14 +810,14 @@ master_state_cb (NMActiveConnection *master,
gpointer user_data)
{
NMActiveConnection *self = NM_ACTIVE_CONNECTION (user_data);
+ NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (self);
NMActiveConnectionState master_state = nm_active_connection_get_state (master);
- NMDevice *master_device = nm_active_connection_get_device (master);
check_master_ready (self);
if ( master_state == NM_ACTIVE_CONNECTION_STATE_DEACTIVATING
- && (!master_device || !nm_device_is_real (master_device))) {
- /* Master failed without ever creating or realizing its device */
+ && !priv->master_ready) {
+ /* Master disconnected before the slave was added */
if (NM_ACTIVE_CONNECTION_GET_CLASS (self)->master_failed)
NM_ACTIVE_CONNECTION_GET_CLASS (self)->master_failed (self);
}