core: unblock failed connections when the master is available
In case the connection is blocked because it failed, the availability
of a master is a good reason to unblock it so that it can be tried
again.
Fixes: a1ea422aad
This commit is contained in:
@@ -1586,6 +1586,7 @@ activate_slave_connections (NMPolicy *self, NMDevice *device)
|
|||||||
guint i;
|
guint i;
|
||||||
NMActRequest *req;
|
NMActRequest *req;
|
||||||
gboolean internal_activation = FALSE;
|
gboolean internal_activation = FALSE;
|
||||||
|
gs_free NMSettingsConnection **connections = NULL;
|
||||||
|
|
||||||
master_device = nm_device_get_iface (device);
|
master_device = nm_device_get_iface (device);
|
||||||
g_assert (master_device);
|
g_assert (master_device);
|
||||||
@@ -1609,11 +1610,7 @@ activate_slave_connections (NMPolicy *self, NMDevice *device)
|
|||||||
internal_activation = subject && nm_auth_subject_is_internal (subject);
|
internal_activation = subject && nm_auth_subject_is_internal (subject);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!internal_activation) {
|
|
||||||
gs_free NMSettingsConnection **connections = NULL;
|
|
||||||
|
|
||||||
connections = nm_settings_get_connections_sorted (priv->settings, NULL);
|
connections = nm_settings_get_connections_sorted (priv->settings, NULL);
|
||||||
|
|
||||||
for (i = 0; connections[i]; i++) {
|
for (i = 0; connections[i]; i++) {
|
||||||
NMConnection *slave;
|
NMConnection *slave;
|
||||||
NMSettingConnection *s_slave_con;
|
NMSettingConnection *s_slave_con;
|
||||||
@@ -1627,10 +1624,20 @@ activate_slave_connections (NMPolicy *self, NMDevice *device)
|
|||||||
if (!slave_master)
|
if (!slave_master)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ( !g_strcmp0 (slave_master, master_device)
|
if ( nm_streq0 (slave_master, master_device)
|
||||||
|| !g_strcmp0 (slave_master, master_uuid_applied)
|
|| nm_streq0 (slave_master, master_uuid_applied)
|
||||||
|| !g_strcmp0 (slave_master, master_uuid_settings))
|
|| nm_streq0 (slave_master, master_uuid_settings)) {
|
||||||
nm_settings_connection_reset_autoconnect_retries (NM_SETTINGS_CONNECTION (slave));
|
NMSettingsConnection *settings = NM_SETTINGS_CONNECTION (slave);
|
||||||
|
NMSettingsAutoconnectBlockedReason reason;
|
||||||
|
|
||||||
|
if (!internal_activation)
|
||||||
|
nm_settings_connection_reset_autoconnect_retries (settings);
|
||||||
|
|
||||||
|
reason = nm_settings_connection_get_autoconnect_blocked_reason (settings);
|
||||||
|
if (reason == NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_FAILED) {
|
||||||
|
reason = NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_UNBLOCKED;
|
||||||
|
nm_settings_connection_set_autoconnect_blocked_reason (settings, reason);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user