about summary refs log tree commit diff
path: root/callouts/nm-dispatcher-action.c
diff options
context:
space:
mode:
Diffstat (limited to 'callouts/nm-dispatcher-action.c')
-rw-r--r--callouts/nm-dispatcher-action.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/callouts/nm-dispatcher-action.c b/callouts/nm-dispatcher-action.c
index 828d8be1..8040853f 100644
--- a/callouts/nm-dispatcher-action.c
+++ b/callouts/nm-dispatcher-action.c
@@ -489,6 +489,10 @@ nm_dispatcher_action (Handler *h,
 	if (!d->persist)
 		d->quit_timeout = g_timeout_add_seconds (10, quit_timeout_cb, NULL);
 
+	/* Hostname changes don't require a device nor contain a connection */
+	if (!strcmp (action, "hostname"))
+		goto dispatch;
+
 	connection = nm_connection_new_from_hash (connection_hash, error);
 	if (connection) {
 		NMSettingConnection *s_con;
@@ -506,10 +510,6 @@ nm_dispatcher_action (Handler *h,
 		*error = NULL;
 	}
 
-	/* Hostname changes don't require a device */
-	if (!strcmp (action, "hostname"))
-		goto dispatch;
-
 	/* interface name */
 	value = g_hash_table_lookup (device_props, NMD_DEVICE_PROPS_INTERFACE);
 	if (!value || !G_VALUE_HOLDS_STRING (value)) {