summary refs log tree commit diff
path: root/src/nm-policy.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nm-policy.c')
-rw-r--r--src/nm-policy.c35
1 files changed, 26 insertions, 9 deletions
diff --git a/src/nm-policy.c b/src/nm-policy.c
index 62ead242..04cbace6 100644
--- a/src/nm-policy.c
+++ b/src/nm-policy.c
@@ -764,7 +764,7 @@ update_system_hostname (NMPolicy *self, const char *msg)
 		/* Grab a hostname out of the device's DHCP6 config */
 		dhcp_config = nm_device_get_dhcp_config (get_default_device (self, AF_INET6), AF_INET6);
 		if (dhcp_config) {
-			dhcp_hostname = nm_dhcp_config_get_option (dhcp_config, "host_name");
+			dhcp_hostname = nm_dhcp_config_get_option (dhcp_config, "fqdn_fqdn");
 			if (dhcp_hostname && dhcp_hostname[0]) {
 				p = nm_str_skip_leading_spaces (dhcp_hostname);
 				if (p[0]) {
@@ -1787,7 +1787,7 @@ device_state_changed (NMDevice *device,
 		if (   sett_conn
 		    && old_state >= NM_DEVICE_STATE_PREPARE
 		    && old_state <= NM_DEVICE_STATE_ACTIVATED) {
-			gboolean block_no_secrets = FALSE;
+			gboolean blocked = FALSE;
 			int tries;
 			guint64 con_v;
 
@@ -1807,15 +1807,32 @@ device_state_changed (NMDevice *device,
 				 */
 				con_v = nm_settings_connection_get_last_secret_agent_version_id (sett_conn);
 				if (   con_v == 0
-				    || con_v == nm_agent_manager_get_agent_version_id (priv->agent_mgr))
-					block_no_secrets = TRUE;
+				    || con_v == nm_agent_manager_get_agent_version_id (priv->agent_mgr)) {
+					_LOGD (LOGD_DEVICE, "connection '%s' now blocked from autoconnect due to no secrets",
+					       nm_settings_connection_get_id (sett_conn));
+					nm_settings_connection_autoconnect_blocked_reason_set (sett_conn,
+					                                                       NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_NO_SECRETS,
+					                                                       TRUE);
+					blocked = TRUE;
+				}
+			} else if (nm_device_state_reason_check (reason) == NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED) {
+				/* A connection that fails due to dependency-failed is not
+				 * able to reconnect until the master connection activates
+				 * again; when this happens, the master clears the blocked
+				 * reason for all its slaves in activate_slave_connections()
+				 * and tries to reconnect them. For this to work, the slave
+				 * should be marked as blocked when it fails with
+				 * dependency-failed.
+				 */
+				_LOGD (LOGD_DEVICE, "connection '%s' now blocked from autoconnect due to failed dependency",
+				       nm_settings_connection_get_id (sett_conn));
+				nm_settings_connection_autoconnect_blocked_reason_set (sett_conn,
+				                                                       NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_FAILED,
+				                                                       TRUE);
+				blocked = TRUE;
 			}
 
-			if (block_no_secrets) {
-				_LOGD (LOGD_DEVICE, "connection '%s' now blocked from autoconnect due to no secrets",
-				       nm_settings_connection_get_id (sett_conn));
-				nm_settings_connection_autoconnect_blocked_reason_set (sett_conn, NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_NO_SECRETS, TRUE);
-			} else {
+			if (!blocked) {
 				tries = nm_settings_connection_autoconnect_retries_get (sett_conn);
 				if (tries > 0) {
 					_LOGD (LOGD_DEVICE, "connection '%s' failed to autoconnect; %d tries left",