mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-26 12:20:09 +01:00
core: allow slaves to autoactivate when master is available
When a master connection is deactivated by user, we set the
autoconnect-blocked reason 'user-request' for the connection and we
propagate the same reason to slaves. Doing so prevents the
autoactivation of slaves when the master is manually activated again,
because the only way to override the 'user-request' blocked reason is
through manual activation of slaves.
Instead what should happen is that the manual deactivation of a master
marks slaves as blocked for failed dependencies. When the master
becomes available again, slaves can autoactivate if the profile allows
it.
https://bugzilla.redhat.com/show_bug.cgi?id=1437598
(cherry picked from commit b31118cfd2)
This commit is contained in:
parent
200e714885
commit
8db2120979
2 changed files with 15 additions and 7 deletions
|
|
@ -4080,6 +4080,7 @@ nm_device_slave_notify_release (NMDevice *self, NMDeviceStateReason reason)
|
|||
break;
|
||||
case NM_DEVICE_STATE_REASON_USER_REQUESTED:
|
||||
new_state = NM_DEVICE_STATE_DEACTIVATING;
|
||||
reason = NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED;
|
||||
master_status = "deactivated by user request";
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -1697,9 +1697,7 @@ device_state_changed (NMDevice *device,
|
|||
NMPolicyPrivate *priv = user_data;
|
||||
NMPolicy *self = _PRIV_TO_SELF (priv);
|
||||
NMActiveConnection *ac;
|
||||
|
||||
NMSettingsConnection *connection = nm_device_get_settings_connection (device);
|
||||
|
||||
const char *ip_iface = nm_device_get_ip_iface (device);
|
||||
NMIP4Config *ip4_config;
|
||||
NMIP6Config *ip6_config;
|
||||
|
|
@ -1801,13 +1799,22 @@ device_state_changed (NMDevice *device,
|
|||
update_routing_and_dns (self, FALSE);
|
||||
break;
|
||||
case NM_DEVICE_STATE_DEACTIVATING:
|
||||
if (nm_device_state_reason_check (reason) == NM_DEVICE_STATE_REASON_USER_REQUESTED) {
|
||||
if (NM_IN_SET (nm_device_state_reason_check (reason),
|
||||
NM_DEVICE_STATE_REASON_USER_REQUESTED,
|
||||
NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED)) {
|
||||
if (connection) {
|
||||
NMSettingsAutoconnectBlockedReason blocked_reason;
|
||||
|
||||
/* The connection was deactivated, so block just this connection */
|
||||
_LOGD (LOGD_DEVICE, "blocking autoconnect of connection '%s' by user request",
|
||||
nm_settings_connection_get_id (connection));
|
||||
nm_settings_connection_autoconnect_blocked_reason_set (connection,
|
||||
NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_USER_REQUEST);
|
||||
_LOGD (LOGD_DEVICE, "blocking autoconnect of connection '%s': %s",
|
||||
nm_settings_connection_get_id (connection),
|
||||
NM_UTILS_LOOKUP_STR (nm_device_state_reason_to_str,
|
||||
nm_device_state_reason_check (reason)));
|
||||
if (nm_device_state_reason_check (reason) == NM_DEVICE_STATE_REASON_USER_REQUESTED)
|
||||
blocked_reason = NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_USER_REQUEST;
|
||||
else
|
||||
blocked_reason = NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_FAILED;
|
||||
nm_settings_connection_autoconnect_blocked_reason_set (connection, blocked_reason);
|
||||
}
|
||||
}
|
||||
ip6_remove_device_prefix_delegations (self, device);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue