From c3fb02641a22412c6094bb0b54d3945dedbe1237 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 17 Apr 2018 07:31:13 +0200 Subject: device: set device's sys-iface-state only shortly before activating device During _new_active_connection() we just create the NMActiveConnection instance to proceed with authorization. The caller might not even authorize, so we must not touch the device yet. Do that only later. --- src/nm-manager.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index 9b0654c7a6..e692aea54f 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -3806,6 +3806,9 @@ _internal_activate_device (NMManager *self, NMActiveConnection *active, GError * return FALSE; } + if (nm_active_connection_get_activation_type (active) == NM_ACTIVATION_TYPE_MANAGED) + nm_device_sys_iface_state_set (device, NM_DEVICE_SYS_IFACE_STATE_MANAGED); + /* Create any backing resources the device needs */ if (!nm_device_is_real (device)) { NMDevice *parent; @@ -4065,9 +4068,6 @@ _new_active_connection (NMManager *self, subject); } - if (activation_type == NM_ACTIVATION_TYPE_MANAGED) - nm_device_sys_iface_state_set (device, NM_DEVICE_SYS_IFACE_STATE_MANAGED); - return (NMActiveConnection *) nm_act_request_new (settings_connection, applied, specific_object, -- cgit v1.2.1