diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2020-07-06 17:30:05 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2020-07-21 09:10:33 +0200 |
commit | 8db15290831bad6fb773658e6bcead952ea65d36 (patch) | |
tree | f0d6e6b29f65e80cb42f22b5e93af35ed932ac99 | |
parent | 2dae6833ad3424d1d5407baef177ea6febd51840 (diff) | |
download | NetworkManager-8db15290831bad6fb773658e6bcead952ea65d36.tar.gz |
core: fix check on master active-connection failure
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.
Before this commit, in some cases a device didn't detect that the
master failed and kept waiting forever.
https://bugzilla.redhat.com/show_bug.cgi?id=1845018
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/568
(cherry picked from commit 0911d2a4ee1c317f455c01cbad048b994f69844d)
(cherry picked from commit 223f741810db9e457ec512c7626bf9e65d82a6cb)
-rw-r--r-- | src/nm-active-connection.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nm-active-connection.c b/src/nm-active-connection.c index f1bb1ede81..5076a1aba4 100644 --- a/src/nm-active-connection.c +++ b/src/nm-active-connection.c @@ -802,14 +802,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); } |